-
Notifications
You must be signed in to change notification settings - Fork 1.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
Kaniko deletes all content inside $HOME
directory when using multiple FROM
elements inside Dockerfile
.
#2764
Comments
Thanks for the issue @GamePlayer-8 . Would you mind providing a bit more detail on the exact path of the secrets being in $HOME and the context? |
The path of secrets of The context of {
"auths": {
"<registry_url>": {
"auth": "<base64 encoded auth data>"
}
}
} I've decided to change |
Thanks for the pointers on this from @aaron-prindle , for this issue, the root cause could be that $HOME fell under the ignored list dirs and would be cleared/ignored after the RUN. Please feel free to correct/supplement if there are anything missing. 🙏 |
We're seeing more files being deleted. Before build: /workspace # ls /
bin crane etc kaniko media opt root sbin sys usr workspace
certs dev home lib mnt proc run srv tmp var
/workspace # ls /usr/local/bin
2to3 idle3 pip3 pydoc3.12 python3-config wheel
2to3-3.12 idle3.12 pip3.12 python python3.12
crane jinjanate pydoc python-config python3.12-config
idle pip pydoc3 python3 scannercli After build: /workspace # ls /
bin dev home lib mnt proc run sh sys usr
certs etc kaniko media opt root sbin srv tmp var
/workspace # ls /usr/local/bin -la
total 8
drwxr-xr-x 2 root root 4096 Nov 6 17:16 .
drwxr-xr-x 5 root root 4096 Nov 6 17:16 .. |
Here's a minimal example using the latest
|
I have run into what I believe is a similar issue. I have reproduced this using the executor:debug container with sha: executor@sha256:b6a520e10252cfbb1898cac88d05f4c7c838cf615d1a588ec63a0d415db6c4c0 Before running kaniko I can |
May be related to #2576 ? |
Im still experiencing this issue when running kaniko in an alpine base image. I tried multiple alternate ways to ignore some directories but no luck it deletes files in /bin /sbin /usr etc, in the end the container continues to work however the environment breaks in various ways |
Duplicate of #1572 |
kaniko removes everything outside of the
as an example |
Is it possible to ignore the whole I am using the debug image so I can use busybox and some function. But after the multistage build I can't do anything. This is a problem in a Gitlab Ci environment. What do you recommend ? I can't even make a Thanks |
Facing the same issue. After cleanup I can't even |
Actual behavior
When I'm using multiple
FROM <image name>
insideDockerfile
kaniko somehow deletes everything inside$HOME
directory (at least when running on root). Causing the push option of the image to error since the credentials are stored in$HOME/.docker
.Expected behavior
Kaniko should build an image with multiple
FROM <image name>
elements just fine, without deleting content inside$HOME
and pushing the image without any problem.To Reproduce
Steps to reproduce the behavior:
kaniko
inside i.e.alpine
container.docker
docker login
Dockerfile
outside of$HOME
directory:docker login
). Use commandkaniko --context . --dockerfile ./Dockerfile --destination your.registry/username/package
ls -a $HOME
the directory should be shown as empty.--cache
flagThe text was updated successfully, but these errors were encountered: