Execute .launch file on starting an existing container

asked 2019-02-27 14:58:58 -0500

rsh95 gravatar image

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!

edit retag flag offensive close merge delete

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.

gvdhoorn gravatar imagegvdhoorn ( 2019-02-28 04:41:09 -0500 )edit

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.

rsh95 gravatar imagersh95 ( 2019-03-01 14:38:35 -0500 )edit

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.

gvdhoorn gravatar imagegvdhoorn ( 2019-03-01 15:35:26 -0500 )edit