Pull docker images from a private repository during docker build?

Julio Guerra picture Julio Guerra · Jun 18, 2015 · Viewed 19.3k times · Source

Is there any way of pulling images from a private registry during a docker build instead of docker hub?

I deployed a private registry and I would like to be able to avoid naming its specific ip:port in the Dockerfile's FROM instruction. I was expecting a docker build option or a docker environment variable to change the default registry.

Answer

cpuguy83 picture cpuguy83 · Jun 18, 2015

The image name should include the FQDN of the registry host. So if you want to FROM <some private image> you must specifiy it as FROM registry_host:5000/foo/bar

In the future this won't be a requirement, but unfortunately for now it is.