-
Notifications
You must be signed in to change notification settings - Fork 0
Docker
Brent Kulwicki edited this page Jun 11, 2023
·
2 revisions
Whenever running a CLI command in a container, you will need to exec inside the container itself. You do that by doing docker exec <conatiner-name> followed by the command line command.
You can list all the docker things with the ls command.
- List containers:
docker container ls - List images:
docker image ls - List volumes:
docker volume ls
Similar to listing Docker stuff, you can remove it with the rm command
- Remove container:
docker container rm <container-name> - Remove image:
docker image rm <image-name> - Remove volume:
docker volume rm <volume-name>
version: "3.8"
services:
db:
image: postgres:14
container_name: new-db
environment:
POSTGRES_PASSWORD: docker
PGDATA: /var/lib/postgresql/data/app
ports:
- "5432:5432"
volumes:
- db-name:/var/lib/postgresql/data/
command: postgres -c 'max_connections=300'
volumes:
db-name: