How can I run a docker image in a kubernetes pod?
A teammate of mine has defined a new docker image and pushed it to my team's private registry. I own some code running in our kubernetes cluster and we need to get my code to effectively docker run gcr.io/our-project/teammates-image:latest
.
I've been looking at enabling docker-in-docker on our kubernetes pods but I'm having little luck. I'm currently experimenting with minikube
and whenever I try to docker run
I get: docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
.
I've added
securityContext:
privileged: true
To my container spec. I suspect I need more configuration but haven't figured out what.
I'm also trying to evaluate whether I can kubectl run --image=gcr.io/our-project/teammates-image:lastest
from within the kubernetes pod.
Is there a "correct" way to run docker images from within a kubernetes pod? How can I run image with docker-in-docker?