Skip to content

"Build from a remote build context, using a Dockerfile from stdin" example code fail #9205

Open
@durandg12

Description

@durandg12

File: develop/develop-images/dockerfile_best-practices.md

In the section Pipe Dockerfile through stdin, in the subsection named "Build from a remote build context, using a Dockerfile from stdin", the following piece of code fails:

docker build -t myimage:latest -f- https://github.com/docker-library/hello-world.git <<EOF
FROM busybox
COPY README.md .
EOF

Error message: COPY failed: stat /var/lib/docker/tmp/docker-builder857130722/README.md: no such file or directory.

After doing some research, I discovered the cause: .md files are listed in the .dockerignore file of the hello-world repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions