Open indianscout opened 2 years ago
Any news on this, I just ran a test and the problem still persists:
$ docker run -v $(pwd):/workspace gcr.io/kaniko-project/executor:latest --dockerfile=./Dockerfile --context=/workspace --no-push
Unable to find image 'gcr.io/kaniko-project/executor:latest' locally
latest: Pulling from kaniko-project/executor
9d4299bbd943: Pull complete
c1848f67e812: Pull complete
8b2826afefe3: Pull complete
21629cece012: Pull complete
0fec4bb73568: Pull complete
7ce3ceba4a72: Pull complete
6d0fb28d82cd: Pull complete
7f04a316205d: Pull complete
a8dae3110e38: Pull complete
Digest: sha256:1f982af0b54be748221d9a35dcfa608660ab3d51229aa56bde5416f75aff7561
Status: Downloaded newer image for gcr.io/kaniko-project/executor:latest
INFO[0000] Resolved base name registry.access.redhat.com/ubi8/ubi-minimal:8.6-902 to dependencies
INFO[0000] Retrieving image manifest registry.access.redhat.com/ubi8/ubi-minimal:8.6-902
INFO[0000] Retrieving image registry.access.redhat.com/ubi8/ubi-minimal:8.6-902 from registry registry.access.redhat.com
INFO[0001] Retrieving image manifest registry.access.redhat.com/ubi8/ubi-minimal:8.6-902
INFO[0001] Returning cached image manifest
INFO[0001] Built cross stage deps: map[0:[.]]
INFO[0001] Retrieving image manifest registry.access.redhat.com/ubi8/ubi-minimal:8.6-902
INFO[0001] Returning cached image manifest
INFO[0001] Executing 0 build triggers
INFO[0001] Building stage 'registry.access.redhat.com/ubi8/ubi-minimal:8.6-902' [idx: '0', base-idx: '-1']
INFO[0001] Unpacking rootfs as cmd RUN echo "Hello stage 1" && touch A_FILE_PATH requires it.
INFO[0004] ARG USER=nobody
INFO[0004] ARG A_FILE_PATH=/usr/bin/a_file
INFO[0004] RUN echo "Hello stage 1" && touch A_FILE_PATH
INFO[0004] Initializing snapshotter ...
INFO[0004] Taking snapshot of full filesystem...
INFO[0005] Cmd: /bin/sh
INFO[0005] Args: [-c echo "Hello stage 1" && touch A_FILE_PATH]
INFO[0005] Running: [/bin/sh -c echo "Hello stage 1" && touch A_FILE_PATH]
Hello stage 1
INFO[0005] Taking snapshot of full filesystem...
INFO[0005] Saving file . for later use
error building image: could not save file: copying file: write /kaniko/0/dev/full: no space left on device
Opened a question on Stackoverflow, since there seems to be no activity to analyze this problem. https://stackoverflow.com/questions/73828076/kaniko-multistage-builds-error-building-image-could-not-save-file-copying-fi
Can confirm we're also running into this
I can confirm the problem on a fresh install of ubuntu jammy with docker 20.10.12 and gcr.io/kaniko-project/executor:v1.9.1-debug. On older ubuntu focal with docker 20.10.12 it works (same kaniko).
error building image: could not save file: copying file: stat /kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/0/kaniko/.docker: file name too long ERROR ERROR: build step 0 "gcr.io/kaniko-project/executor:latest" failed: step exited with non-zero status: 1
when attempting to use it in cloudbuild. using regular docker/cloud shell actually builds the image successfully. It only fails in cloudbuild
sample Dockerfile
FROM gcr.io/kaniko-project/executor:debug AS kaniko
FROM apache/spark-py
COPY --from=kaniko /kaniko//kaniko/ #fails here
WORKDIR /
I am facing the same problem in a gitlab CI pipeline. Even with the hint provided as answer to @indianscout in stack overflow, I still get the same error: "[...] file name too long". Locally (docker) it works, in the pipeline (kaniko - works for all other images) it does not.
I have the same problem. Any updates? :)
Getting the same problem running this in Gitlab CI with kaniko. In the dockerfile I use the kaniko reference directly like
FROM PYTHON:3.10
COPY --from=gcr.io/kaniko-project/executor:debug /kaniko/ /kaniko/
and then it crashes with """ error building image: could not save file: copying file: open /kaniko/0[...many more of these]/kaniko/.docker/config.json: file name too long """ Does somebody know what's going on? Looks like some kind of recursive confusion.
# information found here:
# https://stackoverflow.com/questions/69182455/possible-to-add-kaniko-to-alpine-image-or-add-jq-to-kaniko-image
FROM gcr.io/kaniko-project/executor:debug AS kaniko
FROM python:3.10
# create /kaniko directory
RUN set -e \
&& mkdir -p /kaniko
# have to copy each file and directory seperately
# can't just copy the entire /kaniko directory causes error with repeating /kaniko/0
COPY --from=kaniko /kaniko/.docker/ /kaniko/.docker/
COPY --from=kaniko /kaniko/docker-credential-acr-env /kaniko/docker-credential-acr-env
COPY --from=kaniko /kaniko/docker-credential-ecr-login /kaniko/docker-credential-ecr-login
COPY --from=kaniko /kaniko/docker-credential-gcr /kaniko/docker-credential-gcr
COPY --from=kaniko /kaniko/executor /kaniko/executor
COPY --from=kaniko /kaniko/ssl/ /kaniko/ssl/
COPY --from=kaniko /kaniko/warmer /kaniko/warmer
# install kaniko cert
RUN set -e \
&& cp /kaniko/ssl/certs/ca-certificates.crt/usr/local/share/ca-certificates/kaniko-ca-certificates.crt \
&& update-ca-certificates
# kaniko environment variables
ENV DOCKER_CONFIG=/kaniko/.docker/
ENV PATH="${PATH}:/kaniko"
Same issue
same here
same here. Any solution found?
I am not sure if this might help with the issue but on gitlab I was building a new image with kaniko that was using v1.20.0 but in my Dockerfile that I was trying to build an image with 1.16.0. I specified FROM gcr.io/kaniko-project/executor:v1.16.0 as kaniko
in the Dockerfile but for some reason after build of the docker image the kaniko version was 1.20.0. I am wondering if some how the container executor version of kaniko is being copied.
Also just ran into this issue on v1.9.2-debug, but after upgrading to v1.22.0-debug builds seem stable again.
I am encountering a strange issue when doing multistage build with kaniko. When using COPY --from= in the second stage, kaniko seems to eat up all diskspace in /var/lib/docker (using docker-ce):
The console output when doing a kaniko build looks like:
This does not happen when I build the image with docker-ce:
The Dockerfile to reproduce this looks like:
The fact that kaniko makes docker to eat up all disk-space is causing other docker builds or containers to fail - which is a pretty severe side effect.
I could imagine that this is related with: