-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 should only be run inside of a container #1542
Comments
Any progress? Running into this error after updating to debian bullseye with docker 20.10.5. |
Any update on this ? |
I've encountered the same issue when running a kaniko job on a docker based gitlab-runner. But for me it was failing with I guess I started to have those since the change of c2a919a#diff-cb441f1bc0f59b82d3fec60db5a4e6924c446fce5d868e14f0e2ad4a88d987ed which detects in what containered environment it runs. So as a hack I've added |
GoogleContainerTools/kaniko#1542 Signed-off-by: anthr76 <[email protected]>
"kaniko should only be run inside of a container, run with the --force flag if you are sure you want to continue" error applied as described here GoogleContainerTools/kaniko#1542 its also done in veloren-docker-cli: https://gitlab.com/veloren/veloren-docker-ci/-/commit/c8aa8ac857292cf28e37dfd009c96c43ab02d206?merge_request_iid=50 We didnt had that problem in veloren repo until now.
I have the same problem. I can't identify "what" change precisely (kubernetes version, gitlab runner…) but since I fully reinstall k3s, I encounter the same problem. |
…ble. This is a hack/workaround for the currently unsolved kaniko issue of refusing to build images on non-container/bare-metal environments, see: GoogleContainerTools/kaniko#1542 Workaround for fuseml/fuseml#252
Might this be related to #1592 ? |
We have 2 runners (Debian 10 and Debian 11) with otherwise identical configuration. The Debian 10 runner worked fine but the Debian 11 runner had this issue. The cgroups version was identical (v2). The workaround of @rawyler worked. Here a little more context:
|
I have exactly the same issue (also using Gitlab Runner). I just want to provide a little more information: Node A
Node B
|
This sounds like a likely culprit. If anybody has experience or interest or time to investigate, it would be much appreciated. |
I got the same error when trying Here is my script and result. jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
docker run --rm \
-v $(pwd)/helloworld:/workspace:ro \
gcr.io/kaniko-project/executor:v1.8.0 \
--context dir:///workspace/ \
--no-push \
--verbosity debug $ docker run --rm \
-v $(pwd)/helloworld:/workspace:ro \
gcr.io/kaniko-project/executor:v1.8.0 \
--context dir:///workspace/ \
--no-push \
--verbosity debug
Unable to find image 'gcr.io/kaniko-project/executor:v1.8.0' locally
v1.8.0: Pulling from kaniko-project/executor
...
Digest: sha256:ff98af876169a488df4d70418f2a60e68f9e304b2e68d5d3db4c59e7fdc3da3c
Status: Downloaded newer image for gcr.io/kaniko-project/executor:v1.8.0
DEBU[0000] Getting source context from dir:///workspace/
DEBU[0000] Build context located at /workspace/
DEBU[0000] Copying file /workspace/Dockerfile to /kaniko/Dockerfile
kaniko should only be run inside of a container, run with the --force flag if you are sure you want to continue
Error: Process completed with exit code 1. |
I found the workaround at #1542 (comment). I added - run: |
docker run --rm \
-v $(pwd)/helloworld:/workspace:ro \
-e container=docker \
gcr.io/kaniko-project/executor:v1.8.0 \
--context dir:///workspace/ \
--no-push \
--verbosity debug |
For running in a Kubernetes cluster, you have to declare an environment variable named To configure
For other runtimes, see options. |
We ran into this error with Kaniko v1.3.0 and Google COS cos-105-17412-101-24. Updating to Kaniko v1.11.0 fixed the problem. |
Kaniko seems to have a trouble detecting which container runtime it runs within, so we need to set it explicitly. GoogleContainerTools/kaniko#1542
Actual behavior
Try to build example and fail
"kaniko should only be run inside of a container, run with the --force flag if you are sure you want to continue"
Tested with git context, same error.
I start example vith k3s in lxc container, unprevileged - error, previleged - vork fine.
Expected behavior
Build and "hello"
To Reproduce
k3s kubernetes
Additional Information
gcr.io/kaniko-project/executor:latest
--cache
flagThe text was updated successfully, but these errors were encountered: