问题描述:

I am working on a joint development with another company and we have separate docker regsitry, DNS etc. If I build a docker image and use it as base image in other projects like

FROM abc-regsitry.com/custom_centos:1.0

the other party, who will use the same source to build the image could not resolve the DNS name abc-registry.com. How can I make the docker registry prefix in the FROM directive dynamic ? Are Dockerfile templates our only option ?

网友答案:

You can set up an additional shared repository.

To copy an image to the shared repo

docker pull my-repo.com/myImage
docker tag my-repo.com/myImage shared-repo.com/ourImage
docker push shared-repo.com/ourImage

And they can do

FROM shared-repo.com/ourImage

This way they have a fixed prefix, and the image name is whatever you choose.

相关阅读:
Top