Skip to content

Commit

Permalink
Fix the /kaniko directory permissions in container
Browse files Browse the repository at this point in the history
Create /kaniko directory with world permission to allow the creation of
sub directories by any user when the executor is run as non root. This
can lower the security but shouldn't have any impact in a container.

The tar unpack is the only way I found to have a directory with specific
permission as the image is created from "scratch" which doesn't have any
tool to change the permission otherwise.

Fixes GoogleContainerTools#1363
  • Loading branch information
claudex committed Mar 22, 2022
1 parent cf5ca26 commit 30a1fd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions deploy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ RUN \
cat /etc/ssl/certs/* > /ca-certificates.crt

FROM scratch
# Create kaniko directory with world write permission to allow non root run
ADD files/kaniko.tar /
COPY --from=0 /src/out/executor /kaniko/executor
COPY --from=0 /usr/local/bin/docker-credential-gcr /kaniko/docker-credential-gcr
COPY --from=0 /usr/local/bin/docker-credential-ecr-login /kaniko/docker-credential-ecr-login
Expand Down
Binary file added files/kaniko.tar
Binary file not shown.

0 comments on commit 30a1fd7

Please sign in to comment.