Create a container driver builder

Creates a BuildKit builder with multi-arch and cache export support; the default driver cannot do this

docker buildx create --name multi --use --driver docker-container --driver-opt network=host

tool
docker46 commands
tags
dockerbuildkitci

More docker commands

  • docker buildx build --secret id=token,src=token.txt -t <name> .

    Gives a secret to BuildKit; only RUN --mount=type=secret,id=token can read it, and it does not end up in the history

  • docker context create remote --docker host=ssh://<host> && docker context use remote

    Runs docker against a remote daemon over SSH; no open TCP socket needed

  • docker run --read-only --tmpfs /tmp --security-opt no-new-privileges --cap-drop ALL <name>

    Read-only root filesystem, only /tmp is writable, no privilege escalation; basic container hardening

  • docker events --filter event=oom --filter type=container

    Streams OOM events live to catch containers killed for hitting the memory limit

  • docker buildx build --platform linux/amd64,linux/arm64 -t reg/img:tag --push .

    Builds the image for amd64 and arm64 with BuildKit and pushes it straight to the registry

all 46 docker commands