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

Add Context Directory to tar #13531

Merged
merged 1 commit into from
Mar 24, 2022
Merged

Conversation

cdoern
Copy link
Contributor

@cdoern cdoern commented Mar 16, 2022

podman build fails on remote build when using a relative context directory.
This is because the context dir was not being added to the tar, so when remote
the compat build function would not be able to stat the contextDir.

resolves #13293

Signed-off-by: cdoern [email protected]

@cdoern
Copy link
Contributor Author

cdoern commented Mar 17, 2022

@Luap99 i think that this:

if path == s {
return nil // skip root dir
}
might be the issue. These lines are skipping the context dir when adding things to the tar

could also be this (seems like we use the compat function for the libpod endpoint) we are checking whether the containerfile is in the context dir:

containerFiles = []string{filepath.Join(contextDirectory, "Dockerfile")}
if utils.IsLibpodRequest(r) {
containerFiles = []string{filepath.Join(contextDirectory, "Containerfile")}
if _, err = os.Stat(containerFiles[0]); err != nil {
containerFiles = []string{filepath.Join(contextDirectory, "Dockerfile")}
if _, err1 := os.Stat(containerFiles[0]); err1 != nil {
utils.BadRequest(w, "dockerfile", query.Dockerfile, err)
}
}
}

@cdoern cdoern force-pushed the build branch 3 times, most recently from 8a83e67 to 039699e Compare March 17, 2022 23:10
@cdoern
Copy link
Contributor Author

cdoern commented Mar 17, 2022

@containers/podman-maintainers PTAL. I have tested this on two remote machine and made sure the server does not already have the context directory, and this works properly.

@Luap99
Copy link
Member

Luap99 commented Mar 18, 2022

Please change your commit message/PR description to reflect the current change.

@cdoern cdoern changed the title Create Context Dir on remote Add Context Directory to tar Mar 18, 2022
@cdoern
Copy link
Contributor Author

cdoern commented Mar 18, 2022

seems like I am including too much now in the tar, I will need to add a line back into just include context dir and containerfile not the root directories.

pkg/bindings/images/build.go Outdated Show resolved Hide resolved
podman build fails on remote build when using a relative context directory.
This is because the context dir was not being added to the tar, so when remote
the compat build function would not be able to stat the contextDir.

resolves containers#13293

Signed-off-by: cdoern <[email protected]>
@cdoern
Copy link
Contributor Author

cdoern commented Mar 22, 2022

@containers/podman-maintainers PTAL

@mheon
Copy link
Member

mheon commented Mar 24, 2022

LGTM with two nits, you can fix them if you need to repush, but they're not a big deal

@cdoern
Copy link
Contributor Author

cdoern commented Mar 24, 2022

@mheon I do not think I need to re-push. Should I just leave those as is?

@mheon
Copy link
Member

mheon commented Mar 24, 2022

Sure, unless someone else adds comments before merge

@rhatdan
Copy link
Member

rhatdan commented Mar 24, 2022

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 24, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 24, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cdoern, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 24, 2022
@openshift-merge-robot openshift-merge-robot merged commit 7934b77 into containers:main Mar 24, 2022
@Romain-Geissler-1A
Copy link
Contributor

Hi,

Thanks for this pull request ! ;)

Would it be possible to ask for a backport in branch 4.0 when it will be opened again ?

Cheers,
Romain

@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
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"podman build -f Dockerfile build-root" is broken when using podman-remote
8 participants