Docker Community Forums

Share and learn in the Docker community.

Problem when run my own base image

(Ingenieriainv) #1

Hi, I created my own base image writing this Dockerfile:

FROM scratch
COPY hello /
CMD ["/hello"]

When I build my own base image apparently everything works fine:

root# docker build -t test1:latest .
Sending build context to Docker daemon 3.072 kB
Step 0 : FROM scratch
Step 1 : COPY hello /
 ---> c5629d3f9ade
Removing intermediate container 5cbe3e8d3aa3
Step 2 : CMD /hello
 ---> Running in 88c3a9dda597
 ---> c88c6bb91cc0
Removing intermediate container 88c3a9dda597
Successfully built c88c6bb91cc0
root# docker images
REPOSITORY            TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
test1                           latest              c88c6bb91cc0      44 seconds ago      14 B

But when I run a container from this image appears following error:

root# docker run -d test1
Unable to find image 'test1:latest' locally
Trying to pull repository ...

What am I doing wrong?


(Jeff Anderson) #2


I would recommend using an official build of docker instead of the build in your OS’s repo. Your packager has changed the default/expected behavior of docker.

Uninstall your copy of docker, and there is a script at that can be used to install an official build.



(Ingenieriainv) #3

Thanks Jeff, but im work in offline host with RHEL 7. I installed Docker via rpm, one to one, and their dependencies. Should be work fine, no?

I need to build my own base image, and install some IBM Software. All offline, with IBM binaries over clear base image. It’s possible?


(Jeff Anderson) #4

The redhat version of docker has several changes put in by redhat. One of those changes is this unexpected behavior you are encountering.

(Ingenieriainv) #5

I think i found it.

I was using a “hello” bash file with this code:

echo "I say hello"

But doesn’t work. If i compile hello.asm in my RHEL7 host, my base image works fine when I build it, and run it. So this ultra-simple base image needs a compiled hello binary file.

Thanks alike!