Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
durandg12 opened this issue Aug 5, 2019 · 5 comments
Labels
area/build Relates to Dockerfiles or docker build command lifecycle/frozen

Comments

@durandg12
Copy link

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.

@craig-osterhout craig-osterhout added the area/build Relates to Dockerfiles or docker build command label Aug 3, 2022
@docker-robott
Copy link
Collaborator

There hasn't been any activity on this issue for a long time.
If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

@durandg12
Copy link
Author

/remove-lifecycle stale

@durandg12
Copy link
Author

/lifecycle frozen

@durandg12
Copy link
Author

I still see md files excluded from the dockerignore file

@dvdksn
Copy link
Contributor

dvdksn commented Jul 4, 2023

I can't reproduce this issue. I see that *.md is indeed included in the .dockerignore of the remote context, but the snippet builds just fine for me. @jedevc how does buildx/buildkit deal with .dockerignore in a remote context? Maybe this is a difference in the legacy builder vs buildkit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build Relates to Dockerfiles or docker build command lifecycle/frozen
Projects
None yet
Development

No branches or pull requests

4 participants