-
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 is stucking on copying root #960
Comments
This is my ugly workaround for this: FROM alpine:3.11 as rootfs
RUN echo 7777
# Workaround https://github.com/GoogleContainerTools/kaniko/issues/960
RUN ROOTDIRS=$(find / -maxdepth 1 -mindepth 1 \( -type d -o -type l \) ! -name builds ! -name busybox ! -name dev ! -name etc ! -name kaniko ! -name proc ! -name sys ! -name tmp ! -name var ! -name workspace) \
&& mkdir -p /rootfs/dev /rootfs/proc /rootfs/run /rootfs/sys /rootfs/tmp \
&& cp -ax /etc/ /var /rootfs \
&& rm -rf /rootfs/var/run \
&& ln -s ../run/ /rootfs/var/run \
&& mv $ROOTDIRS /rootfs/
FROM alpine:3.11
COPY --from=rootfs /rootfs/ /sysroot/ |
/area multi-stage builds |
Unfortunately I think this behavior is expected. There are directories at |
But docker and buildkit is working fine with this |
Right, this is specific to the way that kaniko is implemented. |
For what its worth I've run into this when running a COPY command in my Dockerfile using environment variables that don't exist. e.g. |
I'm using
which stalls when |
Following the hint from otiai10/copy#78 opt := Options{
Skip: func(src string) (bool, error) {
stat, err := os.Stat(src)
if err != nil {
return nil, err
}
return stat.mode & (os.ModeDevice | os.ModeNamedPipe | os.ModeSocket) == 0, nil
},
}
err := Copy("your/directory", "your/directory.copy", opt) PS: I'm no Go programmer, so Syntax may be wrong. |
It seems a fix was added to otiai related to this specific issue where it's defaults were changed + functionality added to handle When I attempt the repro Dockerfile suggested above though, I am still seeing a Kaniko build failure despite using an otiai version with that fix PR:
keeping this open for now |
Still hitting this issue. Considering kaniko doesn't support the My use case is that I'm stripping down an existing very large image to remove cruft I don't need, but of course it'll just stack on more layers as you remove the files, so flattening the image is needed afterwards. |
I tried using .dockerignore workaround to include the kaniko dir and the newer exclude option which both have not worked. Any other potential updates on this one causing the bug:
|
Actual behavior
Kaniko is sucking forever when trying to save
/
(root) of previous stageExpected behavior
Kaniko will copy
/
to the specified directory.To Reproduce
Additional Information
Docker image
provided above
Strace log
Kaniko Image (fully qualified with digest):
Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: