💾 Archived View for kelgors.me › wiki › docker.gmi captured on 2023-07-22 at 16:26:06. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

➡️ Next capture (2023-12-28)

-=-=-=-=-=-=-

Docker

Permit user to use docker command

sudo usermod -aG docker <user>

Build and push image

docker login [-u <username>] [server]
docker build -t <[registry/]name[:version]> .
docker push <[registry/]name[:version]>

Build image for multiple cpu architectures

export DOCKER_CLI_EXPERIMENTAL=enabled
docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64
docker buildx create --use --name multi-arch-builder
docker buildx inspect --bootstrap # check architectures
# then you can copy desired architectures to --platform argument
docker buildx build --platform=linux/amd64,linux/arm64,linux/arm/v7 -t kelgors/gemweb:1.0.0 .

Get running containers size

docker ps -as

Remove unused stuff from Docker

# remove dangling images
docker images prune
# remove dangling containers/networks/images
docker system prune
Last-Updated: 2022-08-15