How can I use a local image as the base image with a dockerfile?

前端 未结 4 1295
春和景丽
春和景丽 2020-12-12 23:22

I\'m working on a dockerfile. I just realised that I\'ve been using FROM with indexed images all along.

So I wonder:

  • How can I use one of
4条回答
  •  [愿得一人]
    2020-12-12 23:53

    You can use it without doing anything special. If you have a local image called blah you can do FROM blah. If you do FROM blah in your Dockerfile, but don't have a local image called blah, then Docker will try to pull it from the registry.

    In other words, if a Dockerfile does FROM ubuntu, but you have a local image called ubuntu different from the official one, your image will override it.

提交回复
热议问题