↓ Skip to main content

Docker Cheatsheet

·66 words·1 min·
lrweck
Author
lrweck
Developer writing about tech, observations, and experiments.

The commands I reach for most days, nothing more:

# build with a name
docker build -t myapp .

# run and remove after exit, with a volume
docker run --rm -p 8080:80 -v "$PWD":/app myapp

# exec into a running container
docker exec -it $(docker ps -q) bash

# clean everything
docker system prune -af

Save yourself the pain: put DOCKER_BUILDKIT=1 in your shell profile.

Related