Docker Community Forums

Share and learn in the Docker community.

Copy a container to another machine


Apologies - this seems like a basic question but I have searched and searched and can’t find an answer.

I have 4 x Raspberry Pis all on the same LAN
I have several containers running on each

Once I get a container up and running, I would like to be able to copy just the ENV variables, volume settings etc to another machine. Data (BIND / Volumes) do not need to be copied - just the settings. Not bothered about having to re-download the images.

I often create a docker-compse.yml file to create the container - but of course if I tweak the settings once it is running, the .yml file is out of date.

I kind of expected you’d be able to export a docker-compose file and reuse it but can’t work out how.

Does anyone have any suggestions? The icing on the cake would be to have the image files cached locally - should I set up a docker repository to do that?

Many thanks