Sharing docker container

I’ve multiple docker containers that have been modified via file system updates. These updates are not represented via changes to the dockerFile

This is pseudo code for process :

  • Multiple public IP addresses to one Nginx?
  • Tell difference of a scaled app on Mesos
  • updating docker image given changes to local filesystem
  • docker Failed to create the host-only adapter Windows 7
  • The npm command is not found in my NodeJS docker container
  • NPM install error running Docker on CentOS
  • docker pull image
    docker run image
    docker exec -it <image_id> bash
    'make changes to running docker container image
    exit running docker container
    docker commit <new container name>

    To save the container I can use docker save... and a local copy of container is saved. Can the be pushed to the registry ? Or is registry just for images and not containers ?

    Is the single method of sharing a custom docker container to export it as .tar file and then re-import on other machine ?

  • docker postgres failed to start with specified port
  • How to restore snapshot of docker image (for testing purpose, every test on this same docker image)
  • Mesos/Marathon Memory usage limits for Docker
  • Accessing docker container mysql databases
  • How memory allocation is happening in docker
  • Swarm Cluster Consul setup
  • 2 Solutions collect form web for “Sharing docker container”

    You never share containers, you always share images. The docker commit command that you’ve already used does not save a container, it creates a new image from that container’s file system (documentation):

    Create a new image from a container’s changes



    You can treat an image created by docker commit like you would any other image (create new containers from it, push it to registries, etc.).
    Simply create a new image by committing an existing container, and you can push that image anywhere you want:

    $ docker commit <some-running-container> yourusername/new-image
    $ docker push yourusername/new-image

    If you do not want to use a registry, use the docker save command to export an existing image into a file, and the docker load command to import the image again.

    $ docker commit <some-running-container> yourusername/new-image
    $ docker save yourusername/new-image > new-image.tar
    $ # On another machine:
    $ docker load < new-image.tar

    I dont know if there is any registry exists for sharing containers. Even if there is, it would be against philosophy of docker. I cant think of a use-case where sharing images would fail but containers will succeed. Images are meant to be shared (platform independent) and containers (platform specific) will be created from those images.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.