0

I have been using below to mount docker in my deployment file. This way From the inside of my code, I can build custom images using docker command

volumeMounts:
- name: dockersock
  mountPath: "/var/run/docker.sock"
volumes:
- name: dockersock
  hostPath:
    path: /var/run/docker.sock

Now in newer kubernetes version privileged and hostPath is disabled. Due to this on new kubernetes above will not work.

I know i have few alternatives like Kaniko for building images, but I am not sure how to use it in code and what changes I need to make in my deployment file.

moonkotte
  • 3,661
  • 2
  • 10
  • 25
Hacker
  • 7,798
  • 19
  • 84
  • 154
  • What kind of `code` are you talking about? `kaniko` indeed can be helpful in such case. Have you read the [Getting Started Tutorial](https://github.com/GoogleContainerTools/kaniko/blob/main/docs/tutorial.md)? Do you have issues with setting up and running? Please be more precise. – moonkotte Feb 24 '22 at 17:13
  • I am doing docker build and docker push in code. I just want to know how to load kaniko and do a image build and deploy in code. – Hacker Feb 25 '22 at 04:56
  • What have you tried so far? What the issue are you having? Please provide a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) – moonkotte Feb 25 '22 at 08:04
  • Tried via this https://blog.alexellis.io/quick-look-at-google-kaniko/ but it keeps complaining docker deamon is required. – Hacker Feb 25 '22 at 11:11
  • At this point I can guess that `docker` is required and not a `containerd`. What is the environment? – moonkotte Feb 28 '22 at 09:34

0 Answers0