Building an image in kubernetes using Kompose

0 votes
I have installed Kompose which is the conversion tool for translating the docker compose file to kubernetes resource. How do i build and push docker images? Please help.
Jul 17, 2019 in Kubernetes by Sam
• 6,260 points

1 answer to this question.

0 votes

Kompose supports both building and pushing Docker images. 

When using the build key within your Docker Compose file, your image will:

  • Automatically be built with Docker using the image key specified within your file
  • Be pushed to the correct Docker repository using local credentials (located at .docker/config)

Using a sample docker-compose file:

version: "2"

        build: "./build"

Using kompose up with a build key:

$ kompose up
INFO Build key detected. Attempting to build and push image ''
INFO Building image '' from directory 'build'
INFO Image '' from directory 'build' built successfully
INFO Pushing image 'foo/bar:latest' to registry ''
INFO Attempting authentication credentials '
INFO Successfully pushed image 'foo/bar:latest' to registry ''
INFO We are going to create Kubernetes Deployments, Services and PersistentVolumeClaims for your Dockerized application. If you need different kind of resources, use the 'kompose convert' and 'kubectl apply -f' commands instead.

INFO Deploying application in "default" namespace
INFO Successfully created Service: foo            
INFO Successfully created Deployment: foo         

Your application has been deployed to Kubernetes. You can run 'kubectl get deployment,svc,pods,pvc' for details.
answered Jul 17, 2019 by Sirajul
• 59,070 points

Related Questions In Kubernetes

0 votes
2 answers

Using a local image to create a pod in K8s

I'm not sure but you can try ...READ MORE

answered Apr 29, 2019 in Kubernetes by Vishaka
0 votes
3 answers

Using multiple commands in a kubernetes yaml file

Try something like this: containers: - name: ...READ MORE

answered Apr 23, 2019 in Kubernetes by lyza
0 votes
3 answers

Retry pull image in a kubernetes pod

If the Pod is part of a ...READ MORE

answered Aug 29, 2018 in Kubernetes by Hannah
• 18,570 points
0 votes
1 answer
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,140 points
0 votes
1 answer

What all components is the Master server in Kubernetes made up of?

Kubernetes is a combination of multiple parts ...READ MORE

answered Jul 11, 2019 in Kubernetes by Sirajul
• 59,070 points
0 votes
1 answer

How to build a high availability cluster in Kubernetes?

Add nodes in a HA cluster in ...READ MORE

answered Jul 12, 2019 in Kubernetes by Sirajul
• 59,070 points