How to build an alpine distroless docker image with buildah

TL;DR If you don’t care about distroless bla-bla and just want to know how to create distroless alpine images, click here Distroless ? In a distroless docker image, you won’t find any shell, package manager or utilities such as grep, sed, awk, … It runs only your application and nothing else. Don’t expect to launch commands like docker run -it my-distroless-image something, it will fail with a message like this one:...

February 13, 2022 · 4 min · JC

How to build a docker multiarch image with buildah

Let’s say we want to build a custom multiarch image named my-image. Very simple and minimalistic Dockerfile example: FROM debian:latest With buildah Login to docker hub or your private registry: buildah login docker.io Create a manifest, it is a kind of enveloppe who will contain your docker image with different architectures. buildah manifest create my-manifest Build images and store them in your manifest: for PLATFORM in linux/386 linux/amd64 linux/arm64/v8 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm/v8 linux/s390x linux/ppc64le do buildah bud --manifest my-manifest --platform ${PLATFORM} done $PLATFORM variable use $GOOS and $GOARCH variables, you can get a list by clicking here...

February 9, 2022 · 2 min · JC