0

In this question it turned out, that I cannot use the sha256 mechanism in the FROM line in a Dockerfile to verify I am using the correct locally built non-DockerHub image in another derived image.

Is there another way to verify locally built Docker images? Some best practice maybe?

Community
  • 1
  • 1
Zelphir Kaltstahl
  • 5,722
  • 10
  • 57
  • 86
  • 1
    docker docs do not mention anything about it, so I think BMitch's comment on that question you mentioned is the only answer possible at the moment. – Kevin Kopf May 21 '17 at 14:25

1 Answers1

1

From docs:

By default, docker pull pulls images from Docker Hub. It is also possible to manually specify the path of a registry to pull from

You can start a private docker registry on you localhost with the following command:

docker run -d -p 5000:5000 --restart=always --name registry registry:2

Say your image name isubuntu Then push image to that specific registry with:

docker push localhost:5000/ubuntu

In your Dockerfile you can use:

From localhost:5000/ubuntu
Ahmad Abdelghany
  • 11,983
  • 5
  • 41
  • 36