0

Due to some requirement, I am using dind (docker inside docker) whose docker daemon is used by other container inside the same pod. I want to run this dind container's docker daemon on any port other than 2375.

There is another pod existing inside K8 node which serves all other pods with the docker daemon. But there are some inconsistencies occuring as same docker daemon is used by pods of different services. For the above reason i decided to use dind container in every requiring pod. Thus i had to set the hostNetwork to false, but now the pod is not able to

  • pull any public image.
  • pull any public debian package etc.

I have tried setting up the dns values with 8.8.8.8 and 8.8.4.4, but still the issue is coming.

The only thing is that the hostNetwork=false is a mandatory flag.

Is there any way to make the pod able to pull public images and artifacts while the above flag is set to false ?

Thanks in advance.

Prashant Goel
  • 471
  • 4
  • 7
  • What have you done so far? The DinD port is just like any other port in a Docker container, so it will always be the standard port (2375 for insecure HTTP) when communicating between containers and your choice of port should you choose to publish it to the host. – David Maze May 26 '22 at 10:15
  • @DavidMaze Updated the Question. Please check once. – Prashant Goel May 26 '22 at 13:32
  • I'm not really following why you'd need dozens and dozens of DinD containers, or why you'd need host networking, especially in Kubernetes. (Do you need DinD at all?) A [mcve] would be useful to explain a little more. – David Maze May 26 '22 at 15:05

0 Answers0