From c9970647ba6338aeb29c1bd82d8f22f33b1880b9 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Mon, 12 Jul 2021 15:57:16 -0400 Subject: podman-remote build use .containerignore over .dockerignore $ mkdir zzz;cd zzz $ printf "FROM quay.io/libpod/testimage:20210610\nCOPY ./ ./\nCOPY subdir ./\n" >Dockerfile $ printf "*\nsubdir\n\!*/sub1*\n" >.dockerignore $ mkdir subdir; touch subdir/sub1.txt $ ../bin/podman-remote build . Should fail, but succeeds because we are not sending over the .dockerignore file to the server side. This PR will send the .dockerignore so the server side and use it. Fixes: #10907 Also if both .containerignore and .dockerignore in the context directory, podman-remote should prefer .containerignore and not use .dockerignore. Fixes: #10908 Signed-off-by: Daniel J Walsh --- test/system/070-build.bats | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'test/system/070-build.bats') diff --git a/test/system/070-build.bats b/test/system/070-build.bats index 7046625c6..06ff0c9e2 100644 --- a/test/system/070-build.bats +++ b/test/system/070-build.bats @@ -851,7 +851,7 @@ EOF run_podman rmi -f build_test } -@test "podman build -f test " { +@test "podman build -f test" { tmpdir=$PODMAN_TMPDIR/build-test subdir=$tmpdir/subdir mkdir -p $subdir @@ -877,6 +877,44 @@ EOF run_podman rmi -f build_test } +@test "podman build .dockerignore failure test" { + tmpdir=$PODMAN_TMPDIR/build-test + subdir=$tmpdir/subdir + mkdir -p $subdir + + cat >$tmpdir/.dockerignore <$tmpdir/Containerfile <$tmpdir/.containerignore <$tmpdir/.dockerignore <$tmpdir/Containerfile <