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: -f gets confused #9871

Closed
edsantiago opened this issue Mar 29, 2021 · 12 comments · Fixed by #10550
Closed

podman-remote build: -f gets confused #9871

edsantiago opened this issue Mar 29, 2021 · 12 comments · Fixed by #10550
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

The -f flag is looking for love Dockerfiles in all the wrong places:

$ bin/podman system service --timeout=0

In window 2:

$ mkdir ccc
$ echo "FROM scratch" >ccc/Dockerfile2
$ ./bin/podman-remote build -t foo -f Dockerfile2 ccc
ERRO[0000] 1 error occurred:
        * lstat /path/to/my/current/directory/Dockerfile2: no such file or directory

Error: Post: "http:...long stuff probably related to the previous failure so I'm not going to bother filing an issue for it"

Non-remote podman build works fine.

@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 is there an easy way to add a single file to the copier of the context directory?

@rhatdan
Copy link
Member

rhatdan commented Mar 30, 2021

@edsantiago is finding all of the little warts in podman-remote build. :^).

I have been trying to kill them off as quickly as possible.

@vrothberg
Copy link
Member

@vrothberg @nalind is there an easy way to add a single file to the copier of the context directory?

Yes, that's possible (see https://github.com/containers/podman/blob/master/cmd/podman/containers/cp.go#L362). Looking that the bindings for build, I think that nTar(...) should be replaced with using the copier package. It also supports Excludes among many other things.

@nalind
Copy link
Member

nalind commented Mar 31, 2021

The logic there is already checking for exclusions, and I think that slipping additional files into the tar stream (if we need to emulate something like the multiple-Dockerfiles feature) is going to be marginally easier with the current logic.

@edsantiago
Copy link
Member Author

As an FYI: there are 52 tests in bud.bats that I'm currently skipping because they don't work with podman-remote due to this bug; all of them of the form buildah bud -f path. It seems like a common pattern.

@vrothberg
Copy link
Member

I had a look at the code and it seems that the logic in cmd/podman/images/build.go needs some polishing. IMHO the data passed to the bindings should be fully evaluated since we must tar the files up. Using @edsantiago's reproducer above, we Dockerfile2 as the Dockerfile and /home/vrothberg/ccc as the context directory. I think the Dockerfile should have already been evaluated or at least be relative.

@vrothberg
Copy link
Member

Ah, I have another idea.

@vrothberg
Copy link
Member

Something for bug week. The longer I read the code, the more questions I have.

@github-actions
Copy link

github-actions bot commented May 2, 2021

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

@edsantiago
Copy link
Member Author

Still present. This is the biggest problem facing buildah-bud tests under podman-remote: there are 53 buildah-bud tests that need to be skipped because of this bug.

@github-actions
Copy link

github-actions bot commented Jun 3, 2021

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

rhatdan added a commit to rhatdan/podman that referenced this issue Jun 8, 2021
podman-remote build has to handle multiple different locations
for the Containerfile.  Currently this works in local mode but not
when using podman-remote.

Fixes: containers#9871

Signed-off-by: Daniel J Walsh <[email protected]>
cdoern pushed a commit to cdoern/podman that referenced this issue Jun 9, 2021
podman-remote build has to handle multiple different locations
for the Containerfile.  Currently this works in local mode but not
when using podman-remote.

Fixes: containers#9871

Signed-off-by: Daniel J Walsh <[email protected]>
mheon pushed a commit to mheon/libpod that referenced this issue Jun 11, 2021
podman-remote build has to handle multiple different locations
for the Containerfile.  Currently this works in local mode but not
when using podman-remote.

Fixes: containers#9871

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