Docker

Quick Sheet

My personal Docker quicksheet

cleanup containers (not running)

sudo docker rm $(sudo docker ps -qa)

cleanup images (not tagged)

sudo docker rmi -f $(sudo docker images | grep "<none>" | awk "{print \$3}")

cleanup volumes (orphaned)

sudo docker volume rm $(sudo docker volume ls -qf dangling=true)

auto restart container

sudo docker run -d --restart unless-stopped --name <name> <image>


Architecture switch

enable additional architectures

enable additional architectures

sudo docker run --rm --privileged multiarch/qemu-user-static:register --reset

start Alpine for ARM on an x86

sudo docker run -it --rm multiarch/alpine:armhf-edge /bin/sh
Advertisements