-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
containerignore, remote, Containerfile, broken #17059
Comments
@flouthoc PTAL |
@edsantiago I wonder why is |
@flouthoc ping |
@edsantiago Thanks for the reminder I'll take this. |
Hi @edsantiago , I verified this whole scenario against Test with legacy docker#!/bin/bash
rm -rf /tmp/pm1 /tmp/pm2
mkdir /tmp/pm1 /tmp/pm2
cat >/tmp/pm1/Containerfile <<EOF
FROM alpine
ADD . /testfilter/
RUN find /testfilter/ -print
EOF
# With no files in context dir, error "While reading directory /tmp/pm2: EOF"
touch /tmp/pm2/dummyfile
sudo docker rmi -f foo
sudo docker build -t foo -f /tmp/pm1/Containerfile /tmp/pm2 |& tee /tmp/pm1/log
echo
if grep /Containerfile /tmp/pm1/log; then
echo "GOOD"
else
echo "BAD"
exit 1
fi Output[fl@fedora docker-exp]$ sudo ./test.sh
Untagged: foo:latest
Deleted: sha256:bb1c15b9a7a1ff4486962b806c987965d48d90688e8ac5dfad4658a881ed0a6b
Sending build context to Docker daemon 2.095kB
Step 1/3 : FROM alpine
---> e66264b98777
Step 2/3 : ADD . /testfilter/
---> 05c2dae93ac7
Step 3/3 : RUN find /testfilter/ -print
---> Running in 21289bb11ebb
/testfilter/
/testfilter/dummyfile
Removing intermediate container 21289bb11ebb
---> 4359167dfa89
Successfully built 4359167dfa89
Successfully tagged foo:latest
BAD Test with buildkit#!/bin/bash
rm -rf /tmp/pm1 /tmp/pm2
mkdir /tmp/pm1 /tmp/pm2
cat >/tmp/pm1/Containerfile <<EOF
FROM alpine
ADD . /testfilter/
RUN find /testfilter/ -print
EOF
# With no files in context dir, error "While reading directory /tmp/pm2: EOF"
touch /tmp/pm2/dummyfile
sudo docker rmi -f foo
sudo docker buildx build -t foo -f /tmp/pm1/Containerfile /tmp/pm2 |& tee /tmp/pm1/log
echo
if grep /Containerfile /tmp/pm1/log; then
echo "GOOD"
else
echo "BAD"
exit 1
fi [fl@fedora docker-exp]$ sudo ./test.sh
[sudo] password for fl:
Untagged: foo:latest
Deleted: sha256:4359167dfa89c5d95c48aee1cccbade238ad455650229b59a19e76f550562ed6
Deleted: sha256:05c2dae93ac722f55409acda25e153664e91a0de5af4cab491ed54e563a00d37
Deleted: sha256:cb71464a5c0c34e3d2cc152be9ada39662dfbe3fea23a5cc26e65c71f2b432e8
#1 [internal] load build definition from Containerfile
#1 transferring dockerfile: 158B done
#1 DONE 0.1s
#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 0.1s
#3 [internal] load metadata for docker.io/library/alpine:latest
#3 DONE 0.0s
#4 [1/3] FROM docker.io/library/alpine
#4 DONE 0.0s
#5 [internal] load build context
#5 transferring context: 88B done
#5 DONE 0.1s
#6 [2/3] ADD . /testfilter/
#6 CACHED
#7 [3/3] RUN find /testfilter/ -print
#7 CACHED
#8 exporting to image
#8 exporting layers done
#8 writing image sha256:bb1c15b9a7a1ff4486962b806c987965d48d90688e8ac5dfad4658a881ed0a6b done
#8 naming to docker.io/library/foo done
#8 DONE 0.0s
BAD |
July 2022: test was flaking on new VM images. We needed new images, so I filed containers#15014 and skipped the test. January 2023: no attention from anyone, so I'll try bumping up a dd timeout from 10s to 30s. But in the interim, the test has broken: it used to expect "Containerfile" in output (this was deliberately added in containers#13655)... but containers#16810 changed that so Containerfile no longer appears. @flouthoc argues that this too is deliberate (containers#17059). Okay, so let's change the test then. All I care about is not adding more regressions. Signed-off-by: Ed Santiago <[email protected]>
#16810 broke #13665. "Containerfile" used to appear in output, it no longer does. But because the test was broken, and nobody tried to fix it, we didn't notice.
Reproducer (save this as test-13655)
Steps:
@flouthoc PTAL.
And when this gets re-fixed, please (fingers crossed) try this to see if it fixes the test:
The text was updated successfully, but these errors were encountered: