Closed sandhose closed 2 years ago
It happened: I needed to pop a shell within the container to debug something, but the image does not include one.
I added a debug
variant of the image (based on the debug
variant of the distroless
image), and to avoid building the image from scratch twice, I switched to Docker Buildx bake files, which allows specifying multiple targets at once, building only one build graph, which in the end avoids compiling the Go binary twice for both variants.
I have a similar setup over at https://github.com/matrix-org/matrix-authentication-service
This does two things:
There are a few important things to note about the changes in the Dockerfile:
/etc/passwd
entry for that)export DOCKER_BUILDKIT=1
on Linux/rageshake
binary to be the entrypoint instead of the command. This allows to run the image likedocker run ghcr.io/matrix-org/rageshake -help
instead ofdocker run ghcr.io/matrix-org/rageshake /rageshake -help