Deploying with docker push is slow because there are many images

I’m trying to deploy via docker. I’m using the following workflow:

  1. Build locally
  2. Push my image to docker hub
  3. On the server: pull the image
  4. On the server: start the image

But docker push takes FOREVER. There are like 30 images, and it has to walk through each one and say “Image already exists”. Is there any way to speed this up?

  • Can I run two separate applications on port 80 and different hostnames in Docker Swarm?
  • docker install nsenter , command not found
  • How to mimic Travis CI locally?
  • Reach host with Docker Compose
  • Connecting a Docker container to a network interface / device instead of an IP address
  • Setting volumes in docker-compose.yml file for windows 10 home
  • Alternatively, should I be using a different process to deploy?

  • SSH connection to my container closed by remote host
  • Ansible docker module missing CP command?
  • Extend docker postgres image to create extra database
  • Docker show current registry
  • Docker save only non public layers
  • Changing the default command of base docker images
  • 3 Solutions collect form web for “Deploying with docker push is slow because there are many images”

    If you’re using a local registry, we recently added a redis cache which has helped speed things up tremendously. Details about how to do this are on the registry github page

    https://github.com/docker/docker-registry

    While pushing still takes time on new images, pulls are very fast, as all layers are in the redis cache.

    The most likely reason why you are pushing more/large layers of your images on every deployment is that you have not optimized your Dockerfiles. Here is a nice intro http://blog.tutum.co/2014/10/22/how-to-optimize-your-dockerfile/.

    If you are pushing on AWS ECR, like I was, it may be that docker on your local needs to restart. See thread about AWS ECR slowness:

    https://forums.aws.amazon.com/thread.jspa?threadID=222834

    This may affect other platforms as well. It seems that around 1.12.1 on Mac, anyhow, there are some slowness issues that go away with a restart of Docker.

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