Docker
Konfiguration
Die Konfiguration erfolgt unter /etc/docker/daemon.json
.
Sicherheit
Es sollte die Umgebungsvariable DOCKER_CONTENT_TRUST=1
gesetzt sein. Zudem sollte man die digest (alpine@sha256:bc41182d7ef5ffc53a40b044e725193bc10142a1243f395ee852a8d9730fc2ad
) anstatt einem Tag (alpine:3.16
) verwenden.
Kommandos
Tipps
intermediate images nach build entfernen
How to remove intermediate images from a build after the build? (stackoverflow)
Dockerfile
FROM node as builder
LABEL stage=builder
...
FROM node:dubnium-alpine
...
docker image prune --filter label=stage=builder
Dockerfile for automation
FROM node as builder
ARG BUILD_ID
LABEL stage=builder
LABEL build=$BUILD_ID
...
FROM node:dubnium-alpine
...
build and prune for automation
docker build --build-arg BUILD_ID .
docker image prune --filter label=stage=builder --filter label=build=${BUILD_ID}
Zeit von Host in Container durchreichen
How to make sure docker’s time syncs with that of the host? (stackoverflow.com)
go time
Go’s time doesn’t work under the docker image from scratch (stackoverflow.com)
Void
Images
Referenzen
- Manage sensitive data with Docker secrets (swarm vorausgesetzt)
- Build images with BuildKit (docker docs)
- https://www.composerize.com/
- Docker + nftables (https://riedstra.dev/)
- How to build x86 (and others!) Docker images on an M1 Mac (jaimyn.dev)
- The definitive guide to docker’s default-address-pools option (straz.to)
- How to remove intermediate images from a build after the build? (stackexchange)