Score:1

Is there a way to use Docker inside of a Pod in a Kubernetes cluster with containerd on the nodes

ru flag

I have a Kubernetes cluster running with containerd on the nodes. I don't have the ability to install things on the nodes. My task now is to deploy a pod which can use docker commands inside, for examle a docker pull or push. So docker should work in the container even though it is not installed on the host system. So I can't just mount the docker socket because it doesn't exist on the host. Is there a possibility?

A.B avatar
cl flag
A.B
Did you try Docker-in-Docker: https://hub.docker.com/_/docker ?
TaLeDa avatar
ru flag
I've thought about it too. However, this does not enable all docker functions. Mounting volumes etc. is not possible, for example
SYN avatar
hk flag
SYN
Of course you can mount volumes with docker-in-docker. Although those volumes are mounted from you DIND host perspective: don't expect to attach kubernetes secrets or PVC, unless you mount them first in that DIND sidecar.
Abhijith Chitrapu avatar
tr flag
Hi, if you have resolved your issue as per the above comments; please post the answer. So, that it will be useful for other community members.
Score:1
ru flag

I was finally able to solve the problem with a dind container. This now runs as a second container in the pod. In order to be able to mount volumes, I mounted the corresponding volumes across both containers. Works without problems so far.

Shaked KO avatar
kr flag
Do you mean that you solved it by running a container with `privileged: true`?
TaLeDa avatar
ru flag
yes, the dind container runs with securityContext: privileged: true
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.