-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathDockerfile_test_issue_mz155
More file actions
33 lines (27 loc) · 1.19 KB
/
Dockerfile_test_issue_mz155
File metadata and controls
33 lines (27 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM debian:12.10 AS first-image
RUN mkdir -p /tmp/testdir \
&& echo "hello" > /tmp/testdir/file.txt \
&& touch -d '2000-01-01' /tmp/testdir \
&& touch -d '2000-01-01' /tmp/testdir/file.txt
RUN stat /tmp/testdir \
&& stat /tmp/testdir/file.txt
# assert that snapshot did not touch atime. we can't use diffoci for that,
# as buildkit does not snapshot atime, they are only present during build.
# starting with docker v29 buildkit, when using containerd snapshotter,
# snapshotter will modifity atime on snapshot and can therefore no longer be tested.
RUN if ls -l /proc/1/exe | grep -q '/kaniko/executor'; then \
if [ $(stat -c %X /tmp/testdir) -ne $(date -d '2000-01-01' +%s) ]; then \
echo "FAIL: atime changed on /tmp/testdir"; \
exit 1; \
fi; \
if [ $(stat -c %X /tmp/testdir/file.txt) -ne $(date -d '2000-01-01' +%s) ]; then \
echo "FAIL: atime changed /tmp/testdir/file.txt"; \
exit 1; \
fi; \
else \
echo "PID1 is not Kaniko, skipping check"; \
fi
FROM debian:12.10 AS second-image
COPY --from=first-image /tmp/testdir /tmp/testdir
RUN stat /tmp/testdir \
&& stat /tmp/testdir/file.txt