HiveBrain v1.2.0
Get Started
← Back to all entries
snippetdockerMinor

How to do docker build image from dockerfile on Kubernetes 1.20

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
imagedockerkubernetesdockerfilehowfrombuild

Problem

Kubernetes 1.20 moved from docker to CRI-O as container runtime. I have a scenario where my Jenkins run on kubernetes and does docker build my dockerfile .But the build breaks as docker daemon is not available now.
I tried using Kaniko to build image but the downfall was once image is built i have no chance to scan the image before pushing to container registry. Once the image is built i have to push it immediately. How can i scan it before pushing to registry.

Current process:

  • Jenkins runs on Kubernetes.



  • Pulls code and does the docker build and tag it.



  • Once docker build is successful will a scan the image for vulnerabilities.



  • Once scan passes we push to the container registry.



With Kaniko i can do till step 2 later image goes away I am not able to find the image locally but i can push directly. And pull it and do scan. Any suggestions or alternatives so i can use my old dockerfiles build,scan and push without major changes

Solution

You can take a look at podman, is like run docker but without the need of a daemon.

You can also check buildah

Context

StackExchange DevOps Q#14455, answer score: 1

Revisions (0)

No revisions yet.