Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions common-content/en/module/containers/docker-compose/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
+++
title = "Docker Compose"
time = 120
objectives = [
"Explain the purpose of Docker Compose.",
"Write a Docker Compose configuration including built and pulled images.",
"Connect containers on a network with Docker Compose.",
"Build and run services with Docker Compose.",
"View individual service logs with Docker Compose.",
]
[build]
render = "never"
list = "local"
publishResources = false
+++

Most software systems consist of multiple components (e.g. a frontend, one or more backends, a database, etc). These systems need to be able to talk to each other.

Docker Compose is a tool for running and connecting multiple Docker containers. It uses a config file to define which containers are needed, and how they should be connected.

{{<note type="Exercise">}}
Follow [this guide to Docker Compose](https://betterstack.com/community/guides/scaling-docker/docker-compose-getting-started/). Make sure you have me the learning objectives on this page.
{{</note>}}
29 changes: 29 additions & 0 deletions common-content/en/module/containers/docker-general/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
+++
title = "Docker"
time = 90
objectives = [
"Run applications with `docker` (e.g. `docker run -dp 80:80 docker/getting-started`).",
"Explain what files a Docker container has access to.",
"Explain what processes can be seen from inside a Docker container.",
"Read a `Dockerfile` and explain what each line does.",
"Start and manage docker containers with `docker run`, `docker ps`, `docker stop`, and `docker rm`.",
]
[build]
render = "never"
list = "local"
publishResources = false
+++

Docker is an open platform for developing, deploying, and running applications, based around containers and images. Docker provides tooling and a platform to manage the lifecycle of our containers:

- We develop the application and its supporting components using containers.
- The container becomes the unit for distributing and testing the application.
- When ready, we deploy the application onto a production environment that will handle real workloads.

This works the same whether the production environment is a local data center, a cloud provider, or a hybrid of the two.

{{<note type="Reading and Tutorial">}}
Read [this guide to get an overview of Docker](https://docs.docker.com/get-started/overview/).

To build hands-on familiarity with Docker, complete parts 1, 2 and 3 of [this tutorial](https://docs.docker.com/get-started/workshop/). Make sure you have met the learning objectives on this page.
{{</note>}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
+++
title = "Docker (language-specific)"
time = 90
objectives = [
"Build a Docker image for an application.",
"Optimise the size of a docker image with multi-stage builds.",
"Expose a port from a Docker container and connect to it from the host.",
"Attach a volume to a Docker container.",
"Start, stop, name, and restart a Docker container.",
"Run an existing Docker image published by someone else, and connect to it from your own.",
]
[build]
render = "never"
list = "local"
publishResources = false
+++

For the language you want to work in, find the language-specific tutorial in [the list of guides](https://docs.docker.com/guides/). For example:
* [Go](https://docs.docker.com/language/golang/)
- You only need to do steps 1-4, you can skip configuring CI and running containers in Kubernetes.
* [Java](https://docs.docker.com/guides/java/)
- You only need to do steps 1-3 - you can skip configuring CI and running containers in Kubernetes.
- Note that this tutorial uses `docker-compose` to manage multiple Docker containers - we will learn more about this soon.

Follow the tutorial, and make sure you have met the learning objectives on this page.

Spend some time on these steps, and feel free to complete other tutorials too. It's very important to grasp the core ideas of containers, images and docker:

- Docker is a set of tools for managing containers and images.
- Images are frozen file systems that hold everything a container needs to run.
- Containers are the running application, based on an image.
36 changes: 36 additions & 0 deletions common-content/en/module/containers/intro/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
+++
title = "Containers"
time = 30
objectives = [
"Define a container.",
"Explain why a container is useful.",
"Explain the relationship between a container and an image.",
]
[build]
render = "never"
list = "local"
publishResources = false
+++

A **container** is a kind of [sandboxed](https://en.m.wikipedia.org/wiki/Sandbox_(computer_security)) process on a computer that is isolated from all other processes, unless specifically allowed.

Containers have an isolated filesystem. This filesystem is provided by a container **image**. Since the image contains the container's filesystem, it must contain everything needed to run an application: all dependencies, configurations, scripts, binaries, & other files or data. The image also contains other configuration for the container, such as environment variables, a default command to run, and other metadata.

By building images, and then running containers from the image, we can package whole applications in a way that is transferrable (we can create them completely separately from running them) and highly reproducible. Both of these are very important in a production environment.

The isolation and security allows us to run many containers simultaneously on a host computer. Containers are lightweight and contain everything needed to run the application, so we do not need to rely on what is currently installed on the host (and don't need to worry that it may change between deployments). We can easily share containers while we work, and be sure that everyone we share with gets the same container that works in the same way.

This makes containers & images a very desirable way to build and deploy applications. They are commonly used at many companies.

To summarize, a container:

- is a runnable instance of an image. We can create, start, stop, move, or delete containers
- can be run on local machines, virtual machines or deployed to the cloud
- is portable (can be run on any OS)
- is isolated from other containers and runs its own software, binaries, and configurations

For even more on containers, you can read Julia Evan's fantastic guide to [What even is a container?](https://jvns.ca/blog/2016/10/10/what-even-is-a-container/).

> [!NOTE]
>
> In this track, we'll use the terms containerise and dockerise interchangeably to mean the same thing: making an application run in a container using Docker.
10 changes: 10 additions & 0 deletions org-cyf-tracks/content/containers/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
+++
title = "Containers"
description = "Understand, build, run, and deploy containers."
layout = "module"
track_kinds = ["jobs-after-sdc"]
+++

This track introduces building and running containers using Docker, orchestrating them locally with Docker Compose, and deploying them to AWS.

It assumes you already know how to build working software, including multiple components which need to talk to each other (such as a frontend and a backend).
8 changes: 8 additions & 0 deletions org-cyf-tracks/content/containers/sprints/1/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
title = "Sprint 1"
description = "Building, running, and testing containers locally with Docker."
theme = "Building, running, and testing containers locally with Docker."
layout = "sprint"
menu_level = ["module"]
weight = 1
+++
18 changes: 18 additions & 0 deletions org-cyf-tracks/content/containers/sprints/1/prep/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
+++
title = "Prep"
layout = "prep"
menu_level = ["sprint"]
weight = 1
[[blocks]]
name = "Containers"
src = "module/containers/intro"
[[blocks]]
name = "Docker"
src = "module/containers/docker-general"
[[blocks]]
name = "Docker (language-specific)"
src = "module/containers/docker-language-specific"
[[blocks]]
name = "Docker Compose"
src = "module/containers/docker-compose"
+++
8 changes: 8 additions & 0 deletions org-cyf-tracks/content/containers/sprints/1/success/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
title = "Success"
layout = "success"
menu_level = ["sprint"]
weight = 4
objectives = [[
]]
+++
8 changes: 8 additions & 0 deletions org-cyf-tracks/content/containers/sprints/2/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
title = "Sprint 2"
description = "Building container images on GitHub Actions."
theme = "Building container images on GitHub Actions."
layout = "sprint"
menu_level = ["module"]
weight = 3
+++
9 changes: 9 additions & 0 deletions org-cyf-tracks/content/containers/sprints/2/prep/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
+++
title = "Prep"
layout = "prep"
menu_level = ["sprint"]
weight = 1
[[blocks]]
name = "GitHub Actions"
src = "blocks/coming-soon"
+++
8 changes: 8 additions & 0 deletions org-cyf-tracks/content/containers/sprints/2/success/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
title = "Success"
layout = "success"
menu_level = ["sprint"]
weight = 4
objectives = [[
]]
+++
8 changes: 8 additions & 0 deletions org-cyf-tracks/content/containers/sprints/3/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
title = "Sprint 3"
description = "Deploying containers to AWS."
theme = "Deploying containers to AWS."
layout = "sprint"
menu_level = ["module"]
weight = 4
+++
9 changes: 9 additions & 0 deletions org-cyf-tracks/content/containers/sprints/3/prep/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
+++
title = "Prep"
layout = "prep"
menu_level = ["sprint"]
weight = 1
[[blocks]]
name = "ECR"
src = "blocks/coming-soon"
+++
8 changes: 8 additions & 0 deletions org-cyf-tracks/content/containers/sprints/3/success/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
title = "Success"
layout = "success"
menu_level = ["sprint"]
weight = 4
objectives = [[
]]
+++
Loading