Moving Dockers - Composing Containers Between Hosts

I would like to take the application stack, consisting of 3 docker images and managed by docker-compose, and completely move it from my development machine to the production machine. I know several ways to do this using a dock:

  • Click images in the registry and get them out of production
  • dockers save from development and then docker load on production
  • restore images in production (it is better to maintain dependencies in production, so this is not a good option.)

I am currently leaning towards doing docker saving and then loading docker, but I wonder if there is a way to do this with the whole set of containers that dockers manage?

Thanks in advance

+7
docker docker-compose
source share
1 answer

There is no functionality in Compose to save images created in the Compose file, this is the work of the docker client (as you indicated with docker save and docker load ). Fortunately, this is simple with bash:

 images=(web cache db) for image in images do docker save ${image} > ${image}.tar scp ${image}.tar $yourhost: ssh $yourhost docker load ${image}.tar done 

The remote registry option is perhaps the more “production class." Moving a bunch of images around is likely to be pretty slow, but YMMV.

+6
source share

All Articles