Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying local Docker image (DockerFIle) as local Kubernetes pod

I started Kubernetes master and minion on local machine using Vagrant. I can create a json file for my Kubernetes pod where I can start several public containers.

However, one Docker container is local one, ontop on java:8-jdk, configured with DockerFile.

How can I reference this local Docker container in the kubernetes json pod so Kubernetes can run it?

In other words, does Kubernetes support docker build ;)

like image 655
igr Avatar asked May 22 '15 15:05

igr


People also ask

How do I deploy local Docker image in local Kubernetes?

To deploy the Docker image on the Kubernetes cluster, we are using kubectl. We can also edit the existing deployment by using the kubectl edit command. For editing the docker image, we simply need to update the attribute for containers to save the deployment.

Can I run Docker in Kubernetes pod?

This allows users to pull, build or run Docker images and to use their existing container-based scripts as steps in the workflow. Each step in the workflow is then converted to a Kubernetes Pod, where a Kubernetes Pod can have one or more containers.


1 Answers

After you build the docker image, you can "side-load" it into your locally available images by running docker load -i /path/to/image.tar. Once you've done this, Kubernetes will be able to load the image without reaching out to an external hub.

like image 195
Robert Bailey Avatar answered Sep 24 '22 06:09

Robert Bailey