containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.48k stars 2.39k forks source link

podman build: --ignorefile is a NOP #9570

Closed edsantiago closed 3 years ago

edsantiago commented 3 years ago

Basically, the bud --ignore containerignore test from buildah bud.bats

$ tree -A foo-2
foo-2
├── Containerfile
├── ignoreme
├── subdir
│   ├── sub1.txt
│   └── sub2.txt
├── test1.txt
└── test2.txt
$ cat foo-2/Containerfile
FROM quay.io/libpod/alpine:latest
COPY ./ /tmp/
$ cat foo-2/ignoreme
# comment
*
test!
!test2*
subdir
!/sub1*
$ ./bin/podman build -t testignore --ignorefile foo-2/ignoreme foo-2
STEP 1: FROM quay.io/libpod/alpine:latest
STEP 2: COPY ./ /tmp/
STEP 3: COMMIT testignore
--> 57b35c332a7
57b35c332a7a3b96f1507884c6e11509e71ca3d19831785a42c3dd3dcd935125
$ ./bin/podman run --rm testignore ls -la /tmp
total 16
drwxrwxrwt    3 root     root            90 Mar  2 15:53 .
dr-xr-xr-x   19 root     root             0 Mar  2 15:53 ..
-rw-rw-r--    1 root     root            48 Mar  2 15:50 Containerfile
-rw-rw-r--    1 root     root            41 Mar  2 15:51 ignoreme
drwxrwxr-x    2 root     root            32 Mar  2 15:53 subdir
-rw-rw-r--    1 root     root             6 Mar  2 15:52 test1.txt
-rw-rw-r--    1 root     root             6 Mar  2 15:52 test2.txt

If the file is called .dockerignore, it works as expected.

rhatdan commented 3 years ago

Have you converted this test to a podman system test? I have a PR to fix it, but no test yet, hint hint...

edsantiago commented 3 years ago

I'll write one. Give me an hour please to juggle time for it

rhatdan commented 3 years ago

No problem, I am waiting for the first PR to merge anyways, since this is a follow on.

edsantiago commented 3 years ago

@rhatdan copy-ignore.patch.txt