Build and push for several platforms
Builds the image for amd64 and arm64 with BuildKit and pushes it straight to the registry
docker buildx build --platform linux/amd64,linux/arm64 -t reg/img:tag --push .
More docker commands
-
docker run --rm -it --env-file .env -p 8000:8000 img:tagLocal run with variables from .env; --rm deletes the container on exit
-
docker history --no-trunc img:tagShows each layer with its command and size; helps find what makes the image so big
-
docker system prune -af --volumesDeletes stopped containers and all unused images, networks and volumes
-
docker pull src-reg/img:tag && docker tag src-reg/img:tag dst-reg/img:tag && docker push dst-reg/img:tagPulls the image, adds a new tag and pushes it to another registry
-
docker save img:tag | gzip > img.tar.gzExports an image to move it into an air-gapped network