Skip to content

Commit

Permalink
Semi final slides for 2021-11-08
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Nov 7, 2021
1 parent 16d438c commit faa5d62
Show file tree
Hide file tree
Showing 14 changed files with 167 additions and 100 deletions.
2 changes: 1 addition & 1 deletion 020_advanced/030_layers/slides.template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="center" style="text-align: center; vertical-align: middle" -->
<!-- .slide: id="layers" class="center" style="text-align: center; vertical-align: middle" -->

## Images and Layers

Expand Down
2 changes: 1 addition & 1 deletion 020_advanced/140_multi_arch/buildx.demo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Build for amd64, arm and arm64

# Enable qemu
docker run --privileged --rm tonistiigi/binfmt --install all
docker run --rm --privileged tonistiigi/binfmt --install all

# Create builder
docker buildx create --name mybuilder --use
Expand Down
60 changes: 30 additions & 30 deletions 020_advanced/140_multi_arch/slides.template.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!-- .slide: class="center" style="text-align: center; vertical-align: middle" -->
<!-- .slide: id="multi-arch" class="center" style="text-align: center; vertical-align: middle" -->

## Multi-Architecture Images

--
---

## Multi-Arch Image
## Multi-arch images

### Images only work on a single platform

Expand All @@ -20,42 +20,42 @@ Based on manifest-tool (by Docker Captain Phil Estes)

### Official images are already multi-arch

--
---

## Multi-Arch Image: hello-world

```bash
$ docker run mplatform/mquery hello-world
Image: hello-world
* Manifest List: Yes
* Supported platforms:
- linux/amd64
- linux/arm/v5
- linux/arm/v7
- linux/arm64
- linux/386
- linux/mips64le
- linux/ppc64le
- linux/s390x
- windows/amd64:10.0.17763.1577
$ regctl manifest get --list hello-world
Name: hello-world
Manifests:
Platform: linux/amd64
Platform: linux/arm/v5
Platform: linux/arm/v7
Platform: linux/arm64/v8
Platform: linux/386
Platform: linux/mips64le
Platform: linux/ppc64le
Platform: linux/riscv64
Platform: linux/s390x
Platform: windows/amd64
OSVersion: 10.0.20348.288
Platform: windows/amd64
OSVersion: 10.0.17763.2237
```

--
---

## Multi-Arch Image: docker

```bash
$ docker run mplatform/mquery docker
Image: docker
* Manifest List: Yes
* Supported platforms:
- linux/amd64
- linux/arm/v6
- linux/arm/v7
- linux/arm64
$ regctl manifest get --list docker:latest
Name: docker:latest
Manifests:
Platform: linux/amd64
Platform: linux/arm64/v8
```

--
---

## Demo: Building for other Architectures

Expand All @@ -65,15 +65,15 @@ Prepare for new sub command `buildx`

<!-- include: buildx-1.command -->

--
---

## Demo: Building for other Architectures

<!-- include: buildx-3.command -->

<!-- include: buildx-4.command -->

--
---

## Demo: Build multi-arch with proper tags (1)

Expand All @@ -85,7 +85,7 @@ Build individual images to control tagging

This allows for proper versioning

--
---

## Demo: Build multi-arch with proper tags (2)

Expand Down
2 changes: 1 addition & 1 deletion 020_advanced/170_kernel/slides.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!-- .slide: class="center" style="text-align: center; vertical-align: middle" -->
<!-- .slide: id="kernel" class="center" style="text-align: center; vertical-align: middle" -->

## Kernel
10 changes: 5 additions & 5 deletions 020_advanced/180_heredocs/heredocs.demo
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Heredocs in Dockerfile

# RUN
# Test RUN with script block
docker build . --file Dockerfile.run

# RUN with interpreter
# Test RUN with interpreter
docker build . --file Dockerfile.interpreter

# RUN script
# Test RUN with script
docker build . --file Dockerfile.script

# COPY
# Test COPY with inline file
docker build . --file Dockerfile.copy

# COPY multiple files
# Test COPY with multiple files
docker build . --file Dockerfile.copy-multiple
28 changes: 0 additions & 28 deletions 020_advanced/180_heredocs/slides.md

This file was deleted.

100 changes: 100 additions & 0 deletions 020_advanced/180_heredocs/slides.template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<!-- .slide: id="heredocs" class="center" style="text-align: center; vertical-align: middle" -->

## Heredocs

---

## Heredocs

```bash
$ cat <<EOF
line1
line2
EOF
line1
line2
```

[Supported](https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/syntax.md#here-documents) in `Dockerfile` with experimental syntax >= 1.3-labs

Fist line of `Dockerfile` must be:

```Dockerfile
# syntax=docker/dockerfile:1.3-labs
```

---

## Demo: Heredocs

Use `RUN` like a script block

No more `&&` and `\`

```Dockerfile
RUN <<EOF
ps faux
EOF
```

<!-- include: heredocs-0.command -->

---

## Demo: Heredocs

Use a custom interpreter for the script block

```Dockerfile
RUN bash -xe <<EOF
echo foo
EOF
```

<!-- include: heredocs-1.command -->

---

## Demo: Heredocs

Provide shebang to set interpreter

```Dockerfile
RUN <<EOF
#!/bin/bash
ps faux
EOF
```

<!-- include: heredocs-2.command -->

---

## Demo: Heredocs

Provide inline file

```Dockerfile
COPY --chmod=0755 <<EOF /entrypoint.sh
#!/bin/bash
exec "$@"
EOF
```

<!-- include: heredocs-3.command -->

---

## Demo: Heredocs

Create multiple files in a single `COPY`

```Dockerfile
COPY <<no-recommends <<no-suggests /etc/apt/apt.conf.d/
APT::Install-Recommends "false";
no-recommends
APT::Install-Suggests "false";
no-suggests
```

<!-- include: heredocs-4.command -->
2 changes: 1 addition & 1 deletion 030_remoting/title.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!-- .slide: class="center" style="text-align: center; vertical-align: middle" -->
<!-- .slide: id="remoting" class="center" style="text-align: center; vertical-align: middle" -->

## Docker Remoting
2 changes: 1 addition & 1 deletion 040_inception/title.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!-- .slide: class="center" style="text-align: center; vertical-align: middle" -->
<!-- .slide: id="inception" class="center" style="text-align: center; vertical-align: middle" -->

## Nested Containers
2 changes: 1 addition & 1 deletion 060_security/09_rootless/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ docker context use rootless

## Rootless Inception

Docker Rootless in Docker Rootful
Rootless Docker in rootful Docker

```bash
docker run -d --name dind-rootless --privileged \
Expand Down
6 changes: 3 additions & 3 deletions 060_security/09_rootless/slides.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Rootless Docker IS NOT
## Rootless Docker *IS NOT*

Running as non-root in a container

Expand All @@ -10,9 +10,9 @@ Enabling user namespace mapping

---

## Rootless Docker IS
## Rootless Docker *IS*

Running containers as non-root
Running the daemon as non-root

Based on user namespaces

Expand Down
2 changes: 1 addition & 1 deletion 060_security/09_rootless/title.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!-- .slide: class="center" style="text-align: center; vertical-align: middle" -->
<!-- .slide: id="rootless" class="center" style="text-align: center; vertical-align: middle" -->

## Rootless containers
24 changes: 9 additions & 15 deletions 110_ecosystem/buildkit/k8s/slides.template.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,40 @@
<!-- .slide: class="center" style="text-align: center; vertical-align: middle" -->
<!-- .slide: id="builders" class="center" style="text-align: center; vertical-align: middle" -->

## Remote builders

--
---

## BuildKit and Kubernetes

BuildKit can be used as a build service in Kubernetes

Multiple [examples available](https://github.com/moby/buildkit/tree/master/examples/kubernetes)
BuildKit can be used as a [build service in Kubernetes](https://github.com/moby/buildkit/tree/master/examples/kubernetes)

### Pod

Proof-of-concept

BuildKit understands the schema `kube-pod://`

### Deployment

Multiple pods can run simultaneously

Build is passed to any one of them by the service
Load balancing works

### CLI

`buildx` comes with options to deploy BuildKit based pods

--
---

## Demo: BuildKit and Kubernetes

Pass build to remote pod

<!-- include: manual-0.command -->

<!-- include: manual-2.command -->

<!-- include: manual-3.command -->

--
<!-- include: manual-4.command -->

---

## Managing BuildKit using buildx
## Managing BuildKit using `buildx`

<!-- include: buildx-2.command -->

Expand Down
Loading

0 comments on commit faa5d62

Please sign in to comment.