-
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
Gitlab runner k8s: The build failed when setting the flag --ignore-var-run=false #2649
Comments
I was bitten by this today as well. Seems like kaniko makes incorrect assumptions. Here is a simple example that demonstrates the problem and does not require GitLab, Kubernetes and
Kaniko extracts the source image contents in Line 329 in d7f7bc1
Line 50 in d7f7bc1
kaniko/pkg/constants/constants.go Line 21 in d7f7bc1
And that is the problem. Note that you might get bitten by this in case you execute kaniko multiple times to build multiple images as well. The kaniko argument A simple GitLab Kubernetes Runner test case. Dockerfile: FROM alpine
RUN touch /var/bla .gitlab-ci.yml: test:
image: "gcr.io/kaniko-project/executor:debug"
script:
- >-
/kaniko/executor
--destination image
--no-push
--tar-path=/image.tar
--ignore-var-run=false Running this on a GitLab Kubernetes Runner fails because Setting Lines 309 to 340 in d7f7bc1
This part here seems to fail: Lines 395 to 411 in d7f7bc1
as it assumes that it can just delete stuff. |
Actual behavior
Use gitlab runner (run on k8s) to build Docker image using kaniko.
The build failed when setting the flag
--ignore-var-run=true
.The log with debug enabled
Expected behavior
Suggestion: Should provide the option to explicitly include some specific paths under
/var/run
instead of including all/var/run
as we don't need all stuff under/var/run
. There are cases in which we only need to keep state of some directories, such as/var/run/postgresql
.To Reproduce
Dockerfile
and.gitlab-ci.yml
in this ticket.Additional Information
Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: