Docker Community Forums

Share and learn in the Docker community.

Building from source image hosted in private registry


(Leon Kyneur) #1

I’m trying to work out how to build images when using a private repo and sourcing each iteration from a parent container.

for example
myhub.mydomain.com/project/base:
Dockerfile:
FROM alpine:latest

myhub.mydomain.com/ruby:
Dockerfile
FROM myhub.mydomain.com/project/ruby:

I push both images to my registry just fine however when I build ‘myhub.mydomain.com/ruby’ on my CI server I get the following error:

docker build --rm -t myhub.mydomain.com/project/ruby .
Sending build context to Docker daemon 2.048 kB
Sending build context to Docker daemon 
Step 0 : FROM myhub.mydomain.com/project/base:latest
Pulling repository myhub.mydomain.com/project/base
Error: image project/base:latest not found

Am I sourcing my base image correctly? I don’t reference the short name anywhere however it attempts to build with it. If I pull the base image down to the CI server it’s fine, however not ideal since I would need to know which of my containers are build from which base images (as opposed to using FROM).


(Andy Rothfusz) #2

Have you run docker login myhub.mydomain.com on the machine doing the build? You didn’t say that you were pushing from the same machine as where you do the build.

And is there a :latest tag?


(Leon Kyneur) #3

@rufus thanks - I was missing the latest tag.

It seems I have to be specific about pushing with :latest to the registry for a tag to be created.