error building image: error building stage: failed to take snapshot: archive/tar: write too long
Actual behavior A clear and concise description of what the bug is. I was building a python project and there was an error in the "Taking snapshot of files..." phase
To Reproduce Steps to reproduce the behavior: I use kaniko as a build container in jenkins. Everything seemed fine at first. Since I added a certain pip package, I began to make errors. I think it is because the files have been added to the tar file limit.
Additional Information
- Dockerfile
FROM python:3.10.12-alpine3.17
WORKDIR /usr/local/service
ENV PYTHONPATH /usr/lib/python3.10/site-packages
RUN apk add --no-cache tzdata gcc libffi-dev musl-dev build-base linux-headers py3-pandas
COPY server/requirements.txt .
RUN pip install -r requirements.txt
COPY server .
RUN chmod +x start.sh
CMD ["./start.sh"]
- Build Context
"/kaniko/executor -f `pwd`/${name} --push-retry=3 -c `pwd` --use-new-run --snapshotMode=redo --insecure --skip-tls-verify --cache=true --destination=test-harbor.xxxxx.com/aimath/${cfg.project_name}-${project_name}:$BUILD_NUMBER"
- Kaniko Image (fully qualified with digest) gcr.io/kaniko-project/executor:debug@sha256:91ffcd7c7450560c235406479a476b632efeef9ca036ca4ce32de395a580f83a
Triage Notes for the Maintainers
| Description | Yes/No |
|---|---|
| Please check if this a new feature you are proposing |
|
| Please check if the build works in docker but not in kaniko |
|
Please check if this error is seen when you use --cache flag |
|
| Please check if your dockerfile is a multistage dockerfile |
|
The following is requirements.txt
PyMySQL==1.0.2
sqlparse==0.4.1
Django==3.2.6
djangorestframework==3.12.4
drf-yasg==1.21.3
requests==2.26.0
djangorestframework-simplejwt==5.2.0
django-filter==21.1
uWSGI
phone==0.4.3
sentry-sdk==1.5.7
django-cors-headers==3.10.0
django-rest-swagger==2.2.0
cos-python-sdk-v5
django-redis==5.2.0
pymongo==3.12.0
openpyxl==3.0.7
alibabacloud_push20160801==1.0.3
xlrd2
@ltx0633 was this issue solved somehow or any workaround for this? same error for me.
@ltx0633 was this issue solved somehow or any workaround for this? same error for me.
Maybe it's the tar module, but I'm not an expert in the go language. I built it using buildkit, Buildkit is faster than kaniko. There are fewer mistakes in my environment.
any news here? getting the same but for me it seems random. Im not being able to constantly reproduce..
这里有什么消息吗? 得到相同的但对我来说这似乎是随机的。我无法不断重现..
Unfortunately, no one is dealing with this problem. As I answered earlier, it could be a tar module problem, but I couldn't fix it, and then I used buildkit and so far everything looks fine (https://github.com/moby/buildkit)
any update on this?
Any update? Facing the same issue.
My workaround is to use the --single-snapshot parameter. Then I don't have the problem. Not sure about the implications for caching of intermediate layers, but is not relevant for me.
The previous solution didn't work for me. Any other suggestions?