Building Docker Images Smaller, Rootless and Non-Shell for Kubernetes
After building a Docker image faster, I wanted to build it for the K8s cluster. Running the container on the local machine isn’t the same as running it on a cluster. I’m packaging a Go application in my example. But the same principles apply to any other language. Starting Dockerfile I’m starting with the following Dockerfile(Dockerfile_1): ARG GO_VERSION=1.20.3 FROM golang:${GO_VERSION}-buster as builder WORKDIR /app COPY go.mod go.sum /app/ RUN go mod download -x COPY ....