-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Layer tar files contain entry for root (/) #1375
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
Comments
@neggert Adding "/" does will create files "/etc" when exploded using |
But there aren't any other absolute paths in the tar. Notice there is no leading slash for the paths in Absolute paths in tars are usually a bad idea, to the point where GNU tar ignores them by default. |
Actually, there's a pretty good explanation of the issue in the page I linked.
|
@tejal29 Do you need anymore information on this? We're forced to revert to Docker because Kaniko-built images don't work in our system. |
This appears to be the offending line of code. |
I'm on Nic's team now. We're looking at Makisu as an alternative to Kaniko for building containers to be used in the environment in question. It does not build with
|
We've learned today via uber-archive/makisu#365 that Makisu is deprecated and will no longer be updated after May 4, 2021. That leaves Kaniko as our only currently available option in the long term so we're looking at how we can expedite this change or changing how our internal container runtime handles Kaniko-produced containers with this |
… archive Fixes GoogleContainerTools#1375 Signed-off-by: Zhiyuan Chen <[email protected]>
…ball Fixes GoogleContainerTools#1375 Signed-off-by: Zhiyuan Chen <[email protected]>
…ball Fixes GoogleContainerTools#1375 Signed-off-by: Zhiyuan Chen <[email protected]>
…ball Fixes GoogleContainerTools#1375 Signed-off-by: Zhiyuan Chen <[email protected]>
Actual behavior
Layer tar files contain a header for the path
/
, which looks like an absolute path name and creates problems for the internal non-Docker container runtime we use. Images created using Docker work just fine.Expected behavior
Tar files should not contain absolute paths. GNU tar drops the leading
/
from absolute paths, so this mostly works, but other tools fail to extract images created by Kaniko.To Reproduce
Use this Dockerfile:
Build with kaniko, saving the image locally so that we can inspect it.
docker run -v $PWD:/workspace gcr.io/kaniko-project/executor@sha256:d60705cb55460f32cee586570d7b14a0e8a5f23030a0532230aaf707ad05cecd \ --dockerfile /workspace/Dockerfile --context dir:///workspace/ --tarPath /workspace/image.tar \ --no-push --destination=image
Extract and inspect the image. Observe the first entry:
/
.Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: