Use the shell "test" command instead of "[" to avoid confusion with Dockerfile RUN-syntax

This commit is contained in:
Thomas L. Kjeldsen 2025-05-17 17:08:18 +02:00
parent 7a2f27a5d5
commit f58c294274
1 changed files with 2 additions and 1 deletions

View File

@ -22,6 +22,7 @@ RUN \
ls -lh /usr/local/bin/myfile
FROM base as final
COPY --from=build ["/usr/local/bin/myfile", "/usr/local/bin/"]
RUN [ -u /usr/local/bin/myfile ]
# Test if file exists and its set-user-id bit is set
RUN test -u /usr/local/bin/myfile
LABEL \
description="Testing setuid behavior in Kaniko"