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

podman-remote build, with '*' in .dockerignore: overzealously ignores Dockerfile #9867

Closed
edsantiago opened this issue Mar 29, 2021 · 13 comments · Fixed by #10890
Closed

podman-remote build, with '*' in .dockerignore: overzealously ignores Dockerfile #9867

edsantiago opened this issue Mar 29, 2021 · 13 comments · Fixed by #10890
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. remote Problem is in podman-remote

Comments

@edsantiago
Copy link
Member

Setup:

$ mkdir aaa
$ echo "FROM scratch" >aaa/Dockerfile
$ echo '*' >aaa/.dockerignore
$ ./bin/podman system service --timeout=0

In window 2:

$ ./bin/podman-remote build aaa
Error: stat /dev/shm/libpod_builder306103659/build/Dockerfile: no such file or directory

Regular (non-remote) podman works fine, presumably because it doesn't do the interim copy of the context dir to $TMPDIR:

$ ./bin/podman build aaa
STEP 1: FROM scratch
STEP 2: COMMIT
--> 7c21f8178f5
7c21f8178f56c84713d534e8416eef383467c6bd6f42f0b00948fa0b0f1012a2
@edsantiago edsantiago added kind/bug Categorizes issue or PR as related to a bug. remote Problem is in podman-remote labels Mar 29, 2021
@rhatdan
Copy link
Member

rhatdan commented Mar 30, 2021

@vrothberg @nalind This I guess is an issue with the copier, where we should special case Containerfile and Dockerfile to not be ignored when * is specified.

@edsantiago did you try this out on Docker?

@edsantiago
Copy link
Member Author

I didn't. I'm delighted I mean heartbroken to say I no longer have access to any hosts or VMs with docker.

@rhatdan
Copy link
Member

rhatdan commented Mar 30, 2021

Sadly I still have it installed, for just this type of occurrance, and yes it works on Docker.

@nalind nalind removed the Buildah label Mar 30, 2021
@vrothberg
Copy link
Member

@vrothberg @nalind This I guess is an issue with the copier, where we should special case Containerfile and Dockerfile to not be ignored when * is specified.

I don't see the copier package being used in the build bindings: https://github.com/containers/podman/blob/master/pkg/bindings/images/build.go#L333. As mentioned in the other issue, I think the build bindings should use the copier package.

@rhatdan
Copy link
Member

rhatdan commented Mar 31, 2021

Volunteering?

@vrothberg
Copy link
Member

I am usually volunteered :^) Pipeline is long but we crossed the 200 issues threshold :)

@github-actions
Copy link

github-actions bot commented May 1, 2021

A friendly reminder that this issue had no activity for 30 days.

@edsantiago
Copy link
Member Author

Still present.

@github-actions
Copy link

github-actions bot commented Jun 3, 2021

A friendly reminder that this issue had no activity for 30 days.

@github-actions
Copy link

github-actions bot commented Jul 5, 2021

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Jul 5, 2021

This works for me with the latest in the main branch.

@rhatdan rhatdan closed this as completed Jul 5, 2021
@edsantiago
Copy link
Member Author

It actually doesn't work. I suspect you shortcutted my reproducer above, running podman system service in the same directory as the Dockerfile and .dockerignore. Can you try my exact reproducer, no shortcuts? Reopening while we sort this out.

@edsantiago edsantiago reopened this Jul 6, 2021
rhatdan added a commit to rhatdan/podman that referenced this issue Jul 10, 2021
If the user specifies "*" in a .dockerignore or a .containerignore
then podman-remote build should not exclude the Dockerfile or
Containerfile or any content pointed to by `-f` in the context
directory.

We still need these files on the server side to complete the build.

Fixes: containers#9867

Signed-off-by: Daniel J Walsh <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. remote Problem is in podman-remote
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants