- Build an image from a Dockerfile:
docker build -t [image name] .
- Run a container from an image:
docker run [image name]
- List running containers:
docker ps
- List all containers (including stopped ones):
docker ps -a
- Stop a running container:
docker stop [id]
- Remove a stopped container:
docker rm [docker name]
- List all images:
docker images
- Delete an image:
docker rmi [image name]
- Pull and run an image in one step:
docker run [image name]
- Pull an image without running it:
docker pull [image name]