Skip to main content

Docker

Docker commands for containers and images

DevOps

Images

docker pull <image>

Download image

docker images

List images

docker build -t <name> .

Build image from Dockerfile

docker rmi <image>

Remove image

docker tag <img> <new>

Tag an image

docker push <image>

Push to registry

Containers

docker run <image>

Create and start container

docker run -d <image>

Run in background

docker run -p 8080:80 <img>

Map ports

docker run -v /host:/container

Mount volume

docker ps

List running containers

docker ps -a

List all containers

docker stop <container>

Stop container

docker start <container>

Start container

docker rm <container>

Remove container

Inspection & Logs

docker logs <container>

View logs

docker logs -f <container>

Follow logs

docker inspect <container>

Detailed info

docker exec -it <c> bash

Enter container shell

docker stats

Container resource usage

Docker Compose

docker-compose up

Start services

docker-compose up -d

Start in background

docker-compose down

Stop and remove

docker-compose logs

View logs

docker-compose build

Build services

docker-compose ps

List services

Cleanup

docker system prune

Remove unused data

docker image prune

Remove unused images

docker container prune

Remove stopped containers

docker volume prune

Remove unused volumes

Privacy-First Developer Toolkits - 35+ Browser-Based Tools