Jimmix
Jimmix

Reputation: 6546

Ubuntu Docker - php composer build from the official Dockerfile fails, COPY failed Step 9/12 stat no such file or directory

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.

Upvotes: 0

Views: 193

Answers (1)

K. Railis
K. Railis

Reputation: 184

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.

Upvotes: 0

Related Questions