Skip to content

Commit

Permalink
markdown source builds
Browse files Browse the repository at this point in the history
Auto-generated via `{sandpaper}`
Source  : 348e75a
Branch  : main
Author  : Francisco Herrerías-Azcué <36694679+fherreazcue@users.noreply.github.com>
Time    : 2024-11-06 17:47:37 +0000
Message : Merge pull request #75 from UoMResearchIT/3rd-pass-b

3rd pass b
  • Loading branch information
actions-user committed Nov 6, 2024
1 parent 15b4e3c commit 9dcd0f2
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 30 deletions.
2 changes: 1 addition & 1 deletion docker-cli-toolkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Entrypoint: [python /spuc/spuc.py]

or even get them both at the same time:
```bash
docker inspect spuacv/spuc:latest -f "Command: {{.Config.Cmd}}\nEntrypoint: {{.Config.Entrypoint}}"
docker inspect spuacv/spuc:latest -f $'Command: {{.Config.Cmd}}\nEntrypoint: {{.Config.Entrypoint}}'
```
```output
Command: [--units iuhc]
Expand Down
6 changes: 3 additions & 3 deletions docker-compose-microservices.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ To demonstrate the power of Docker Compose and microservices, let's take a look

The [Apperture](https://github.com/UoMResearchIT/apperture) project is a stack of microservices.
They combine to provide a log-in secure web portal with built in user-management.
It is maintained by the University of Manchester's Research IT team, and can easily be combined with other stacks to provide them with a log in portal.
It is maintained by the University of Manchester's Research IT team, and can easily be combined with other stacks to provide them with a login portal.

`Apperture` is comprised primarily of a `docker-compose.yml` file.
`Apperture` is comprised primarily of a compose file.
Just like we have been looking at!

The full `docker-compose.yml` file is available [on github](https://raw.githubusercontent.com/UoMResearchIT/apperture/refs/heads/main/docker-compose.yml).
Expand Down Expand Up @@ -126,7 +126,7 @@ One of the most powerful features of Docker Compose is the ability to combine st
There is no reason we cannot combine the Apperture stack with the SPUC stack we have been working with in previous lessons!

This would allow us to protect our SPUC interface with the Apperture portal.
An important addition!We need to ensure poachers cannot falsely record sightings of the rare yet valuable unicorns!
An important addition! We need to ensure poachers cannot falsely record sightings of the rare yet valuable unicorns!

This can be achieved by making a couple of changes to the SPUC `docker-compose.yml` file.

Expand Down
37 changes: 28 additions & 9 deletions docker-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ spuc-1 |
```

So we have our container running! With a couple of interesting bits of output to note:
- A container was created named `spuc-1`

- A container was created named `docker-intro-spuc-1`. (The directory name is prepended to the container name)
- A `network` was created for the container - we will dig into what this means later!
- The tool is running in the foreground, so we can see the output of the tool

Expand Down Expand Up @@ -147,7 +148,7 @@ $ docker compose up -d
```
```output
[+] Running 1/1
✔ Container docker-intro-testing-spuc-1 Started 0.2s
✔ Container docker-intro-spuc-1 Started 0.2s
```

Of course, this means we can no longer see the logs! But we can still access them using the `logs` command.
Expand Down Expand Up @@ -230,7 +231,7 @@ spuc-1 |
Now... something a bit funny is happening here... why are we seeing the output twice?

We've actually started the same container twice!
We only `stop`ped the container when we pressed `[Ctrl+C]`, and didn't remove it.
We only **stopped** the container when we pressed `[Ctrl+C]`, and didn't remove it.

### Removing the container when it stops

Expand All @@ -240,8 +241,8 @@ docker compose down
```
```output
[+] Running 2/2
✔ Container docker_intro-spuc-1 Removed 10.1s
✔ Network docker_intro_default Removed 0.2s
✔ Container docker_intro-spuc-1 Removed 0.1s
✔ Network docker_intro_default Removed 0.2s
```

In practice, you only *need* to use `down` if you *need* to remove the container.
Expand All @@ -262,8 +263,8 @@ docker compose up -d
```
```output
[+] Running 2/0
✔ Network docker-intro-testing_default Created 0.0s
✔ Container spuc_container Created 0.0s
✔ Network docker-intro_default Created 0.0s
✔ Container spuc_container Started 0.0s
```

::::::::::::::::::::::::::::: spoiler
Expand Down Expand Up @@ -309,7 +310,7 @@ docker compose up -d
```
```output
[+] Running 2/0
✔ Network docker-intro-testing_default Created 0.0s
✔ Network docker-intro_default Created 0.0s
✔ Container spuc_container Created 0.0s
```

Expand Down Expand Up @@ -415,6 +416,19 @@ $ docker volume ls
$ docker compose down -v
$ docker volume ls
```
```output
DRIVER VOLUME NAME
local docker_intro_spuc-volume
local spuc-volume
[+] Running 3/3
✔ Container spuc_container Removed 10.2s
✔ Volume docker_intro_spuc-volume Removed 0.0s
✔ Network docker_intro_default Removed 0.2s
DRIVER VOLUME NAME
local spuc-volume
```

### Setting an environment variable

Expand Down Expand Up @@ -702,7 +716,8 @@ volumes:
Now both services will be started at the same time!

```bash
docker compose up
docker compose up -d
docker compose logs
```
```output
[+] Running 3/3
Expand Down Expand Up @@ -812,6 +827,10 @@ volumes:
spuc-volume:
```
```bash
docker compose up -d
```

Now, the SPUC service is only accessible from within the Docker network!
Try doing a curl to register a sighting and you wont be able to.
However, you can still register sightings through the SPUCSVi interface.
Expand Down
34 changes: 17 additions & 17 deletions md5sum.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
"file" "checksum" "built" "date"
"CODE_OF_CONDUCT.md" "c93c83c630db2fe2462240bf72552548" "site/built/CODE_OF_CONDUCT.md" "2024-11-05"
"LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2024-11-05"
"config.yaml" "b7d1eb78e16127db4410987ce19e1956" "site/built/config.yaml" "2024-11-05"
"index.md" "21107af9e64902e529737a4b8d27d13d" "site/built/index.md" "2024-11-05"
"episodes/introduction.Rmd" "1603c83f8eca9cec0f1a71d9198b5999" "site/built/introduction.md" "2024-11-05"
"episodes/docker-desktop.Rmd" "82d1d3a1fe21fbc1c309908bf025ef26" "site/built/docker-desktop.md" "2024-11-05"
"episodes/docker-cli-toolkit.Rmd" "18d0bfcd17debe25bfe8c8afde29f5f9" "site/built/docker-cli-toolkit.md" "2024-11-05"
"episodes/docker-volumes.Rmd" "82e70f8ce69609e10c7b416056b68a89" "site/built/docker-volumes.md" "2024-11-05"
"episodes/docker-hub.Rmd" "96c1a5944df8006ceda602e9ba16b0f5" "site/built/docker-hub.md" "2024-11-05"
"episodes/docker-run-configuration.Rmd" "196721cce2ad47a15ed252a6c4c0ca6c" "site/built/docker-run-configuration.md" "2024-11-05"
"episodes/dockerfiles.Rmd" "e5801afa22656fe80e9bfdd9e34b4e36" "site/built/dockerfiles.md" "2024-11-05"
"episodes/docker-compose.Rmd" "d2d09b1d239829ea5cab9e79cb95f1a8" "site/built/docker-compose.md" "2024-11-05"
"episodes/docker-compose-microservices.Rmd" "9586f2bbf685b7dadc597ae4191e7574" "site/built/docker-compose-microservices.md" "2024-11-05"
"instructors/instructor-notes.md" "fcee6075930831d9bb66fa7f6b944aa7" "site/built/instructor-notes.md" "2024-11-05"
"learners/setup.md" "deed63c9ba25ea089c474717ccbea121" "site/built/setup.md" "2024-11-05"
"profiles/learner-profiles.md" "60b93493cf1da06dfd63255d73854461" "site/built/learner-profiles.md" "2024-11-05"
"renv/profiles/lesson-requirements/renv.lock" "a8e606bfd968ba4a9d9afbf7ee524a40" "site/built/renv.lock" "2024-11-05"
"CODE_OF_CONDUCT.md" "c93c83c630db2fe2462240bf72552548" "site/built/CODE_OF_CONDUCT.md" "2024-11-06"
"LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2024-11-06"
"config.yaml" "b7d1eb78e16127db4410987ce19e1956" "site/built/config.yaml" "2024-11-06"
"index.md" "21107af9e64902e529737a4b8d27d13d" "site/built/index.md" "2024-11-06"
"episodes/introduction.Rmd" "1603c83f8eca9cec0f1a71d9198b5999" "site/built/introduction.md" "2024-11-06"
"episodes/docker-desktop.Rmd" "82d1d3a1fe21fbc1c309908bf025ef26" "site/built/docker-desktop.md" "2024-11-06"
"episodes/docker-cli-toolkit.Rmd" "3482e849b70ac177ef1e2fb0d52b7055" "site/built/docker-cli-toolkit.md" "2024-11-06"
"episodes/docker-volumes.Rmd" "82e70f8ce69609e10c7b416056b68a89" "site/built/docker-volumes.md" "2024-11-06"
"episodes/docker-hub.Rmd" "96c1a5944df8006ceda602e9ba16b0f5" "site/built/docker-hub.md" "2024-11-06"
"episodes/docker-run-configuration.Rmd" "196721cce2ad47a15ed252a6c4c0ca6c" "site/built/docker-run-configuration.md" "2024-11-06"
"episodes/dockerfiles.Rmd" "e5801afa22656fe80e9bfdd9e34b4e36" "site/built/dockerfiles.md" "2024-11-06"
"episodes/docker-compose.Rmd" "ec23da75b788e5e79f542da86a10f30a" "site/built/docker-compose.md" "2024-11-06"
"episodes/docker-compose-microservices.Rmd" "fdb23ae83debf0ff58bd905ff83564ff" "site/built/docker-compose-microservices.md" "2024-11-06"
"instructors/instructor-notes.md" "fcee6075930831d9bb66fa7f6b944aa7" "site/built/instructor-notes.md" "2024-11-06"
"learners/setup.md" "deed63c9ba25ea089c474717ccbea121" "site/built/setup.md" "2024-11-06"
"profiles/learner-profiles.md" "60b93493cf1da06dfd63255d73854461" "site/built/learner-profiles.md" "2024-11-06"
"renv/profiles/lesson-requirements/renv.lock" "a8e606bfd968ba4a9d9afbf7ee524a40" "site/built/renv.lock" "2024-11-06"

0 comments on commit 9dcd0f2

Please sign in to comment.