-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16d438c
commit faa5d62
Showing
14 changed files
with
167 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.