Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 1.13 KB

docker.md

File metadata and controls

62 lines (41 loc) · 1.13 KB

Docker

Resource Usage

Display resource usage statistics:

docker stats --no-stream

Platform

Choose another CPU architecture:

docker run --platform linux/amd64 -it debian:latest

Dockerfile:

FROM --platform=linux/amd64 debian:latest

Entrypoint vs. CMD

docker run -it --entrypoint "/bin/sh -c" alpine:latest <CMD>
Entrypoint CMD
Default: /bin/sh -c none
Dockerfile: ENTRYPOINT CMD
CLI: --entrypoint
  • The entrypoint is always executed
  • CMD only if specified in the Dockerfile or given in the docker run command

Buildkit

DOCKER_BUILDKIT=1 docker build --tag image:name .

By integrating BuildKit, users should see an improvement on performance, storage management, feature functionality, and security.

https://docs.docker.com/develop/develop-images/build_enhancements/

Prune

Remove all Volumes:

docker volume rm $(docker volume ls -q --filter dangling=true)

Remove all Images:

docker system prune