0
votes

I want to build a docker image of a composer from this page composer:latest and taking exactly this Dockerfile

but when I do this in console:

$ wget -O Dockerfile https://raw.githubusercontent.com/composer/docker/edf4f0abf50da5d967408849434b9053a195b65f/1.7/Dockerfile
$ docker build -t mycomposer:latest .

i got this build error:

Step 9/12 : COPY docker-entrypoint.sh /docker-entrypoint.sh COPY failed: stat /var/lib/docker/tmp/docker-builder787686173/docker-entrypoint.sh: no such file or directory

How come I have any error building from official Dockerfile? This way works:

$ docker pull composer:latest

but I need to build an image basing on a local Dockerfile instead of just pulling it.

1
Do you have the whole github.com/composer/docker repository, or just the one Dockerfile? Why can't you use the prebuilt image?David Maze
no, I just downloaded Dockerfile itself and used it to do build (two lines of console commands). I wanted to use prebuild Dockerfile as a template to make my own version but I'm not even able to build it unmodified.Jimmix

1 Answers

0
votes

The command

COPY docker-entrypoint.sh /docker-entrypoint.sh

in the Dockerfile tries to copy the file docker-entrypoint.sh from your current directory.
However you have only downloaded the Dockerfile.

If you visit the actual directory on the repository you will notice another file entitled
docker-entrypoint.sh. If you download this file too and place it in the same directory
as the Dockerfile the image will be built without errors.