Skip to content
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 #2

Open
VF-mbrauer opened this issue Mar 12, 2022 · 5 comments
Open

Kaniko should only be run inside of a container #2

VF-mbrauer opened this issue Mar 12, 2022 · 5 comments

Comments

@VF-mbrauer
Copy link

After applying your kaniko-demo with minikube version: v1.25.2 I am getting after running the kaniko-git.yaml this error:

Enumerating objects: 196, done.
Counting objects: 100% (196/196), done.
Compressing objects: 100% (156/156), done.
Total 196 (delta 38), reused 191 (delta 33), pack-reused 0
kaniko should only be run inside of a container, run with the --force flag if you are sure you want to continue

Resulting in

NAME     READY   STATUS   RESTARTS   AGE
kaniko   0/1     Error    0          2m55s
@VF-mbrauer
Copy link
Author

So, after adding the additional argument --force it is working.
It still gives me the WARNING

WARN[0000] kaniko is being run outside of a container. This can have dangerous effects on your system

but at least it works.
Just wondering if that has to do with the latest Kubernetes version or the latest image of Kaniko?
And why does it say Running outside of a container, because it isn't, it runs inside??

@vfarcic
Copy link
Owner

vfarcic commented Mar 13, 2022

That's strange. I just created a Minikube cluster based on v1.25.2 (just as yours) and went through all the commands https://gist.github.com/627fcfbfbc17a683a70210947e02eaa3. It worked from the get-go and --force was not mentioned anywhere in the logs. The only thing that comes to my mind is that there might be differences in how minikube creates a cluster depending on the virtualization you chose. I'm running it with VirtualBox? If you can let me know what you're using for virtualization, I can try to reproduce it again.

@VF-mbrauer
Copy link
Author

I am using macOS. Minikube runs in a docker environment. So, the usual macOS Minikube installation as it comes from the Kubernetes webpage. I did not touch the standard configuration.

Just let me know if you need anything else.
Thanks.

@vfarcic
Copy link
Owner

vfarcic commented Mar 13, 2022

I just reproduced it by using Docker as a Minikube driver (I used VirtualBox before). I still do not know why that is happening but, at least, now we know that it's related to Docker or, to be more precise, when a Kubernetes cluster is running inside a container (Minikube with docker driver is actually k8s inside a container). I suspect that the same issue would happen with KinD.

Unfortunately, I can't say much more since I'm not using Docker or Minikube myself. I switched to Rancher Desktop a while ago and set those two up (Minikube and Docker) for this issue inside a laptop that is hardly working anymore.

@tt5
Copy link

tt5 commented Mar 20, 2022

microk8s:

[...]
spec:
  containers:
  - name: kaniko
    env:
      - name: container
        value: 'docker'
[...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants