Robotics StackExchange | Archived questions

Execute .launch file on starting an existing container

Hi!

I am new to Docker and ROS. From what I understand, it is possible to execute a file (say a .py) on the start of a container by including the name of the file in the CMD section of the dockerfile.

I wanted to execute a .launch file as soon as I start a container. The container is being used (via the Portainer UI) to access files on the raspberry pi. How can I do this?

Thanks!

Asked by rsh95 on 2019-02-27 15:58:58 UTC

Comments

This would be no(t significantly) different from starting anything "non ROS" in a Docker container.

We're here to help, but what have you found yourself already? You refer to the "CMD section", so you must have already found / tried something.

Asked by gvdhoorn on 2019-02-28 05:41:09 UTC

Thanks for responding. I have tried to manually write the dockerfile by looking at other containers (from the same project that i'm working on -Duckietown) and filling in ENTRYPOINT and CMD, but it fails to build the image. I can't even seem to find the files that the other containers reference.

Asked by rsh95 on 2019-03-01 15:38:35 UTC

I can't even seem to find the files that the other containers reference.

without showing at least your Dockerfile and giving more information about file & directory layout this is still too vague.

Asked by gvdhoorn on 2019-03-01 16:35:26 UTC

Answers