mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-09-30 12:44:05 +02:00
Extracting the layers of the filesystem in order will make it easier to extract cached layers and deal with hardlinks. This PR implements extracting in order and adds an integration tests to make sure hardlinks are extracted properly. It also fixes two bugs I found when extracting symlinks: 1. We'd get a "file exists" error when trying to symlink to an existing file with a whiteout later in the layer tarball 2. We'd get a "file exists" error when trying to create a symlink from a file that was created in a prior layer (perhaps as a regular file or as a symlink pointing to someting else) To fix both of these, we resolve all symlinks in a layer at the end. I also added logic to delete any existing paths before creating the symlink.
4 lines
189 B
Plaintext
4 lines
189 B
Plaintext
FROM alpine@sha256:5ce5f501c457015c4b91f91a15ac69157d9b06f1a75cf9107bf2b62e0843983a AS stage1
|
|
RUN apk --no-cache add git
|
|
RUN rm /usr/bin/git && ln -s /usr/libexec/git-core/git /usr/bin/git
|