diff --git a/08-running-containers/Makefile b/08-running-containers/Makefile index eab4a7d..3faeab9 100644 --- a/08-running-containers/Makefile +++ b/08-running-containers/Makefile @@ -43,6 +43,7 @@ docker-run-all: docker run -d \ --name db \ -e POSTGRES_PASSWORD=foobarbaz \ + -v pgdata:/var/lib/postgresql/data \ -p 5432:5432 \ --restart unless-stopped \ postgres:15.1-alpine diff --git a/08-running-containers/docker-compose.yml b/08-running-containers/docker-compose.yml index 0db8a14..be1bd85 100644 --- a/08-running-containers/docker-compose.yml +++ b/08-running-containers/docker-compose.yml @@ -42,7 +42,11 @@ services: restart: unless-stopped db: image: postgres:15.1-alpine + volumes: + - pgdata:/var/lib/postgresql/data environment: - POSTGRES_PASSWORD=foobarbaz ports: - 5432:5432 +volumes: + pgdata: \ No newline at end of file diff --git a/09-interacting-with-containers/README.md b/09-interacting-with-containers/README.md new file mode 100644 index 0000000..9c066f2 --- /dev/null +++ b/09-interacting-with-containers/README.md @@ -0,0 +1,35 @@ +# Interacting with Containers and Other Docker Objects + +## Images + +1) ls +2) build +3) tag +4) pull +5) push +6) rm +7) prune +8) save + +## Containers + +1) ls +2) run +3) start +4) attach +5) exec +6) logs +7) top +8) cp +9) stop +10) kill +11) prune +12) export + +## Volumes + +1) ls +2) create +3) inspect +4) rm +5) prune