mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
Merge pull request #13530 from vrothberg/fix-13529
podman create: building local pause image: do not read ignore files
This commit is contained in:
@ -56,6 +56,7 @@ ENTRYPOINT ["/catatonit", "-P"]`, catatonitPath)
|
|||||||
CommonBuildOpts: &buildahDefine.CommonBuildOptions{},
|
CommonBuildOpts: &buildahDefine.CommonBuildOptions{},
|
||||||
Output: imageName,
|
Output: imageName,
|
||||||
Quiet: true,
|
Quiet: true,
|
||||||
|
IgnoreFile: "/dev/null", // makes sure to not read a local .ignorefile (see #13529)
|
||||||
IIDFile: "/dev/null", // prevents Buildah from writing the ID on stdout
|
IIDFile: "/dev/null", // prevents Buildah from writing the ID on stdout
|
||||||
}
|
}
|
||||||
if _, _, err := rt.Build(context.Background(), buildOptions, tmpF.Name()); err != nil {
|
if _, _, err := rt.Build(context.Background(), buildOptions, tmpF.Name()); err != nil {
|
||||||
|
@ -248,8 +248,7 @@ Labels.created_at | 20[0-9-]\\\+T[0-9:]\\\+Z
|
|||||||
run_podman inspect --format '{{.ID}}' $IMAGE
|
run_podman inspect --format '{{.ID}}' $IMAGE
|
||||||
imageID=$output
|
imageID=$output
|
||||||
|
|
||||||
run_podman version --format "{{.Server.Version}}-{{.Server.Built}}"
|
pauseImage=$(pause_image)
|
||||||
pauseImage=localhost/podman-pause:$output
|
|
||||||
run_podman inspect --format '{{.ID}}' $pauseImage
|
run_podman inspect --format '{{.ID}}' $pauseImage
|
||||||
pauseID=$output
|
pauseID=$output
|
||||||
|
|
||||||
|
@ -605,7 +605,7 @@ EOF
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Regression test for #9867
|
# Regression test for #9867 and #13529
|
||||||
# Make sure that if you exclude everything in context dir, that
|
# Make sure that if you exclude everything in context dir, that
|
||||||
# the Containerfile/Dockerfile in the context dir are used
|
# the Containerfile/Dockerfile in the context dir are used
|
||||||
@test "podman build with ignore '*'" {
|
@test "podman build with ignore '*'" {
|
||||||
@ -620,6 +620,15 @@ cat >$tmpdir/.dockerignore <<EOF
|
|||||||
*
|
*
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# Prior to the fix for #13529, pod-create would fail with 'error building
|
||||||
|
# at STEP COPY .../catatonit' because of the local .dockerignore file was
|
||||||
|
# used.
|
||||||
|
pushd "${tmpdir}"
|
||||||
|
run_podman pod create
|
||||||
|
run_podman pod rm $output
|
||||||
|
run_podman rmi $(pause_image)
|
||||||
|
popd
|
||||||
|
|
||||||
run_podman build -t build_test $tmpdir
|
run_podman build -t build_test $tmpdir
|
||||||
|
|
||||||
# Rename Containerfile to Dockerfile
|
# Rename Containerfile to Dockerfile
|
||||||
|
@ -6,13 +6,7 @@ load helpers
|
|||||||
function teardown() {
|
function teardown() {
|
||||||
run_podman pod rm -f -t 0 -a
|
run_podman pod rm -f -t 0 -a
|
||||||
run_podman rm -f -t 0 -a
|
run_podman rm -f -t 0 -a
|
||||||
run_podman image list --format '{{.ID}} {{.Repository}}'
|
run_podman ? rmi $(pause_image)
|
||||||
while read id name; do
|
|
||||||
if [[ "$name" =~ /podman-pause ]]; then
|
|
||||||
run_podman rmi $id
|
|
||||||
fi
|
|
||||||
done <<<"$output"
|
|
||||||
|
|
||||||
basic_teardown
|
basic_teardown
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,6 +383,15 @@ function journald_unavailable() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Returns the name of the local pause image.
|
||||||
|
function pause_image() {
|
||||||
|
# This function is intended to be used as '$(pause_image)', i.e.
|
||||||
|
# our caller wants our output. run_podman() messes with output because
|
||||||
|
# it emits the command invocation to stdout, hence the redirection.
|
||||||
|
run_podman version --format "{{.Server.Version}}-{{.Server.Built}}" >/dev/null
|
||||||
|
echo "localhost/podman-pause:$output"
|
||||||
|
}
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
# _add_label_if_missing # make sure skip messages include rootless/remote
|
# _add_label_if_missing # make sure skip messages include rootless/remote
|
||||||
###########################
|
###########################
|
||||||
|
Reference in New Issue
Block a user