sam
sam

Reputation: 1290

How to use local docker containers with Kubernetes

I have been trying Kubernetes, I have setup a master and minions in AWS. The documentation on docker + Kubernetes seems to be lacking, or maybe I was looking for it in the wrong place.

Lets say I build my docker containers on a local box (not in AWS). I donot have a docker registry.

Is it possible for me to tell Kubernetes to use my local containers when spinning up pods? Or do my containers need to be put in a docker registry?

Upvotes: 14

Views: 8510

Answers (1)

Antoine Cotten
Antoine Cotten

Reputation: 2762

If the image was built on a host where Kubernetes is running, then yes, Kubernetes may use it on some conditions:

  • your pod is scheduled on a host where your image exists (pre-built / pre-pulled image scenario)
  • your pod pull policy is set to IfNotPresent (see Updating Images)

Using a private registry would make your life easier though, on top of that it's very easy to set up a local Docker registry with Kubernetes.

Upvotes: 9

Related Questions