Skip to content

Commit 8089eed

Browse files
committed
Adds extracted episodes code files
1 parent d64ad77 commit 8089eed

File tree

9 files changed

+1198
-0
lines changed

9 files changed

+1198
-0
lines changed
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
2+
3+
4+
5+
## Pulling and Listing Images
6+
```bash
7+
docker pull spuacv/spuc:latest
8+
```
9+
10+
## The structure of a Docker command
11+
Image: A diagram showing the syntactic structure of a Docker command
12+
13+
## Listing Images
14+
```bash
15+
docker image ls
16+
```
17+
## Inspecting
18+
```bash
19+
docker inspect spuacv/spuc:latest
20+
```
21+
```bash
22+
docker inspect spuacv/spuc:latest -f "Command: {{.Config.Cmd}}"
23+
```
24+
```bash
25+
docker inspect spuacv/spuc:latest -f "Entrypoint: {{.Config.Entrypoint}}"
26+
```
27+
```bash
28+
docker inspect spuacv/spuc:latest -f $'Command: {{.Config.Cmd}}\nEntrypoint: {{.Config.Entrypoint}}'
29+
```
30+
31+
## Default Command
32+
Image: A diagram representing the lifecycle of a container
33+
34+
### Further examples of container lifecycle
35+
Image: Further details and examples of the lifecycle of a container
36+
37+
38+
## Running
39+
```bash
40+
docker run spuacv/spuc:latest
41+
```
42+
```bash
43+
docker run -d spuacv/spuc:latest
44+
```
45+
## Listing Containers
46+
```bash
47+
docker ps
48+
```
49+
```bash
50+
docker ps -a
51+
```
52+
## Logs
53+
```bash
54+
docker logs ecstatic_nightingale
55+
```
56+
```bash
57+
curl -X PUT localhost:8321/unicorn_spotted?location=moon\&brightness=100
58+
```
59+
## Exposing ports
60+
```bash
61+
docker run -d -p 8321:8321 spuacv/spuc:latest
62+
```
63+
```bash
64+
docker ps
65+
```
66+
```bash
67+
curl -X PUT localhost:8321/unicorn_spotted?location=moon\&brightness=100
68+
```
69+
```bash
70+
docker logs unruffled_noyce
71+
```
72+
## Setting the name of a container
73+
```bash
74+
docker run -d --name spuc_container -p 8321:8321 spuacv/spuc:latest
75+
```
76+
```bash
77+
docker stop unruffled_noyce
78+
docker rm unruffled_noyce
79+
```
80+
81+
### Killing containers
82+
```bash
83+
docker kill ecstatic_nightingale
84+
```
85+
86+
```bash
87+
docker run -d --name spuc_container -p 8321:8321 spuacv/spuc:latest
88+
```
89+
```bash
90+
docker logs -f spuc_container
91+
```
92+
93+
### Logs
94+
95+
## Executing commands in a running container
96+
```bash
97+
docker exec spuc_container cat config/print.config
98+
```
99+
```bash
100+
docker exec -it spuc_container bash
101+
```
102+
```bash
103+
apt update
104+
apt install tree
105+
tree
106+
```
107+
108+
## Interactive sessions
109+
```bash
110+
docker run -it alpine:latest
111+
```
112+
113+
## Reviving Containers
114+
```bash
115+
docker kill spuc_container
116+
```
117+
```bash
118+
docker start spuc_container
119+
```
120+
```bash
121+
docker stats
122+
```
123+
## Cleaning up
124+
```bash
125+
docker kill spuc_container
126+
```
127+
```bash
128+
docker rm spuc_container
129+
```
130+
```bash
131+
docker image rm spuacv/spuc:latest
132+
```
133+
```bash
134+
docker system prune
135+
```
136+
### Automatic cleanup
137+
```bash
138+
docker run -d --rm --name spuc_container -p 8321:8321 spuacv/spuc:latest
139+
```
140+
141+
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
2+
3+
4+
5+
## Microservices
6+
## Microservices in Docker Compose
7+
```yml
8+
services:
9+
proxy:
10+
image: 'jc21/nginx-proxy-manager:latest'
11+
ports:
12+
- '80:80'
13+
- '443:443'
14+
depends_on:
15+
- authelia
16+
healthcheck:
17+
test: ["CMD", "/bin/check-health"]
18+
19+
whoami:
20+
image: docker.io/traefik/whoami
21+
22+
authelia:
23+
image: authelia/authelia
24+
depends_on:
25+
lldap:
26+
condition: service_healthy
27+
volumes:
28+
- ${PWD}/config/authelia/config:/config
29+
environment:
30+
AUTHELIA_DEFAULT_REDIRECTION_URL: https://whoami.${URL}
31+
AUTHELIA_STORAGE_POSTGRES_HOST: authelia-postgres
32+
AUTHELIA_AUTHENTICATION_BACKEND_LDAP_URL: ldap://apperture-ldap:3890
33+
34+
lldap:
35+
image: nitnelave/lldap:stable
36+
depends_on:
37+
lldap-postgres:
38+
condition: service_healthy
39+
environment:
40+
LLDAP_LDAP_BASE_DN: dc=example,dc=com
41+
LLDAP_DATABASE_URL: postgres://user:pass@lldap-postgres/dbname
42+
volumes:
43+
- lldap-data:/data
44+
45+
lldap-postgres:
46+
image: postgres
47+
volumes:
48+
- lldap-postgres-data:/var/lib/postgresql/data
49+
healthcheck:
50+
test: ["CMD-SHELL", "pg_isready -U lldap"]
51+
52+
volumes:
53+
lldap-data:
54+
lldap-postgres-data:
55+
```
56+
Image: Apperture Services: Showing a user accessing WhoAmI via the web portal, which is protected by Authelia, which authenticates against an LDAP server, which pulls user data from a Postgres database.
57+
## Combining Stacks
58+
```yml
59+
# SPUC docker-compose.yml
60+
61+
+ networks:
62+
+ apperture:
63+
+ external: true
64+
+ name: apperture_default
65+
```
66+
Image: SPUC and Apperture Services: Showing a user accessing the SPUC interface via the web portal.
67+
## Rapid extension
68+
Image: SPUC and Apperture Services: Showing a user accessing the SPUC interface via the web portal, which is protected by Authelia, which authenticates against an LDAP server, which pulls user data from a Postgres database. The SPUC interface communicates with a Postgres database, a RabbitMQ message queue, a Telegraf sensor, and a MinIO object store.
69+
## They Lived Happily Ever After
70+
Image: Thank you for supporting the SPUA!

0 commit comments

Comments
 (0)