Commit 17c9e1df authored by Paddy's avatar Paddy 🐧

Fixed some minor bugs:

- Some typo
- Fixed some titles
- Links
parent 676d45b2
Pipeline #560 passed with stage
in 2 minutes and 3 seconds
# What we are going to talk about:
## What we are going to talk about:
- Using Docker to manage containers
- Where containers come from
......@@ -12,19 +12,20 @@
----
# Let's talk about WHAT IS a container (reeeeally briefly)
# Let's talk about WHAT IS a container
### (reeeeally briefly)
---
# Container: What is it and what is not
![MagicMeme](https://giphy.com/embed/12NUbkX6p4xOO4)
![MagicMeme](https://www.reactiongifs.com/r/mgc.gif)
----
### What is it and what is not
## What is it and what is not
Containers are not some kind of sorcery, but use specific features of the Linux kernel:
Containers are not some kind of magic, but use specific features of the Linux kernel:
- Namespaces
- Cgroups
......@@ -32,25 +33,25 @@ Containers are not some kind of sorcery, but use specific features of the Linux
----
### Namespaces really TL;DR
## Namespaces really TL;DR
Namespaces are a mechanism of the kernel to isolate a process so it can't access other process on the system (unless they both share the same namespaces)
Namespaces are a mechanism of the kernel to isolate a program so it can't access other process on the system.
----
### Cgroups really TL;DR
## Cgroups really TL;DR
CGroups area a mechanis of the kernel to limit which resources a process can access.
----
### Seccomp-bpf really TL;DR
## Seccomp-bpf really TL;DR
Seccomp-bpf is a mechanism of the kernel to limit which syscall a process can call.
----
### Containers are VM?
## Containers are VM?
Nope, absolutly nope.
......@@ -60,6 +61,10 @@ Nope, absolutly nope.
- The host OS and the container share the very same kernel, while VM do not.
----
## Containers
Container are a way to have an application runnig safely and isolated without stressing too much the host system.
---
......@@ -111,18 +116,26 @@ $ docker start/stop container_name
----
## Docker: Volume
## Docker: Volumes
Ok, nice, but container are stateless. How can we save some data?
----
## Docker: Volume
## Docker: Volumes
If we want to make data persistant, we need some place where to store it, and there come in to play the volumes.
----
## Docker: Volumes
Docker can create and manage volume where our application can store (or read) our data.
----
## Some examples
```bash
# Execute a container binding a local directory
$ docker run -d -p 8080:80 -v ./local/dir:/usr/local/apache2/conf httpd
......@@ -139,11 +152,10 @@ $ docker run -d -p 8080:80 -v myVol:/usr/local/apache2/conf httpd
---
# This containers are tasty! Where I can get some more?
# Where do the containers come from?
----
## Where do containers come from?
## Where do the containers come from?
When we run `docker run [options] httpd` we are asking docker to go and get the container `httpd`. Where?
......@@ -151,7 +163,7 @@ In a registry!
----
## Where do containers come from? Registry!
## Where do the containers come from? Registry!
A registry is (more or less) a repository of prebuild containers.
......@@ -159,7 +171,7 @@ There are several registry that we can use to pull or push containers: [Docker H
----
## Where do containers come from? Registry!
## Where do the containers come from? Registry!
How we can do it?
......@@ -187,6 +199,10 @@ How we can make one?
To make a container we need to define in a file, called *Dockerfile*, all the steps that we need to perform to make our own image with our target application (webserver, application server, ecc)
----
## Containers DIY
Docker define a DSL (Domain Specific Language) to declare each of this steps.
**N.B.** A best practice is to mantain the configuration separated from the application, so we can reuse multiple times the same containers.
......@@ -204,7 +220,7 @@ RUN echo "Hello World!"
## Container DIY
And to build a container we have to run:
Once created our Dockerfile, we can build a container:
```bash
$ docker build -f Dockerfile -t TagName
......@@ -216,6 +232,10 @@ $ docker build -f Dockerfile -t TagName
Ok, nice, we can specific which packages we want, which command to run and docker will do that for us.
----
## Container DIY
But what if we want to make a container with a program that we wrote or that we must build from scratch?
We have to install all the dependencies or compile it and compy inside the imatge.
......@@ -245,6 +265,8 @@ Multi stage builds are (obv) multiple builds of multiple container where we can
# Manage multiple containers
![MagiMouse](https://66.media.tumblr.com/tumblr_ln7yapoOeG1qeegbeo1_500.gifv)
----
## Manage multiple containers
......@@ -313,6 +335,9 @@ volumes:
# Links
- [Docker](https://www.docker.com/)
- [Dockerfile Reference](https://docs.docker.com/engine/reference/builder/)
---
......
<section class="intro">
<h1>Podman</h1>
<h2>Running container in a safe way</h2>
<h1>Docker</h1>
<h2>Let's run some containers</h2>
<img src="./poul/img/logo-text-white.svg"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment