Search code examples
dockerdeploymentcontainerskubernetesdocker-registry

Docker + Kubernetes build


I am trying to use Docker + Kubernetes for my application management.

I have installed kubectl, kubeadm, kubelet (got the steps from google docs) for Kubernetes cluster.

Now cluster is having 2 node(1 Master, 1 Child)

I have a customize Dockerfile , how can it use it as a Kubernetes pods ?

If this is not possible, How to transmit the docker build to the Kubernetes child from master.


Solution

  • You could use a private Docker registriy outside or inside the cluster or work with local (pre-pulled) images.

    1. Outside the cluster you might want to look at these:

    2. Inside the cluster you might want to look at the Private Docker Registry in Kubernetes

    3. If you're not interested to use a registry, you could also build the image on every Kubernetes node so that Docker doesn't have to pull it. To avoid that Kubernetes tried to pull anyways you would then have to set the imagePullPolicy of your containers to Never. That's described within the official documentation.