Build multi-platform images

You can use the plugin Buildx to build images for multiplatform:

# Setup buildx
$ docker buildx create --use

# Build for amd64 and arm64
$ docker buildx build --platform linux/amd64,linux/arm64 . --push -t <image-name>


Stop / remove all Docker containers

$ docker stop $(docker ps -a -q)
$ docker rm $(docker ps -a -q)
  1. List containers with docker ps. The argument -a/--all include also the stopped ones and -q/--quiet displays only the numeric IDs.
  2. Use docker stop and docker rm with the output of the first command (bash command substitution).