3

Assuming I have registered a repo at Docker Hub, called MyRepo. Assuming I am working on a Docker image called MyImage. Assuming I have configured Docker Hub to build images from Dockerfiles available in my GitHub repo.

Problem: (I usually use the docker run shorthand instead of pulling, creating and starting.) Once I pull the image from Docker Hub, docker always uses the locally saved image for creating containers. Question: Is there a way to configure Docker to always check for newer versions of the image at Docker Hub and, if applicable, pull before creating containers?

learningtech
  • 83
  • 1
  • 7

1 Answers1

1

There is no built in way to do this in docker, but you could write a simple bash script or set an alias for docker run which does a docker pull $IMAGE beforehand. If you already have the latest image docker will not download it again.

john.dough
  • 103
  • 10
  • You're right. There's a long time open issue in Docker issue tracker for that: https://github.com/docker/docker/issues/13331 – Greg Dubicki Aug 15 '16 at 12:15