Category Archives: Docker

How To: Move a docker container to another host

Saving this here for future reference.

If you wan’t to move a container that you’ve set up (i.e. from development to production) and you don’t yet want to push it to docker hub, here’s a way to move it:

  1. Export the container to a tarball
    docker export <CONTAINER ID> > /home/export.tar
  2. More your tarball to the new machine
  3. Import it back
    cat /home/export.tar | docker import – some-name:latest