diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-07-12 10:24:56 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-12 10:24:56 -0400 |
commit | 788c2d136b91f1d714e4665ecd41ea452c72eba0 (patch) | |
tree | f53ca59f233bf4dcd3010b0886038e598060e147 /test | |
parent | bef1f03d3ca8bfd90f4cbb295d99bf97df74a815 (diff) | |
parent | 48ff2ef5a36df054a6aaf30ee34574ee1ec0b6d7 (diff) | |
download | podman-788c2d136b91f1d714e4665ecd41ea452c72eba0.tar.gz podman-788c2d136b91f1d714e4665ecd41ea452c72eba0.tar.bz2 podman-788c2d136b91f1d714e4665ecd41ea452c72eba0.zip |
Merge pull request #10890 from rhatdan/main
Don't exclude Dockerfile, Containerfiles from tar content
Diffstat (limited to 'test')
-rw-r--r-- | test/system/070-build.bats | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/system/070-build.bats b/test/system/070-build.bats index c45a661fe..7046625c6 100644 --- a/test/system/070-build.bats +++ b/test/system/070-build.bats @@ -509,6 +509,40 @@ EOF done } +# Regression test for #9867 +# Make sure that if you exclude everything in context dir, that +# the Containerfile/Dockerfile in the context dir are used +@test "podman build with ignore '*'" { + local tmpdir=$PODMAN_TMPDIR/build-test-$(random_string 10) + mkdir -p $tmpdir + + cat >$tmpdir/Containerfile <<EOF +FROM scratch +EOF + +cat >$tmpdir/.dockerignore <<EOF +* +EOF + + run_podman build -t build_test $tmpdir + + # Rename Containerfile to Dockerfile + mv $tmpdir/Containerfile $tmpdir/Dockerfile + + run_podman build -t build_test $tmpdir + + # Rename Dockerfile to foofile + mv $tmpdir/Dockerfile $tmpdir/foofile + + run_podman 125 build -t build_test $tmpdir + is "$output" ".*Dockerfile: no such file or directory" + + run_podman build -t build_test -f $tmpdir/foofile $tmpdir + + # Clean up + run_podman rmi -f build_test +} + @test "podman build - stdin test" { # Random workdir, and random string to verify build output workdir=/$(random_string 10) |