mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-03-02 01:10:20 +00:00
Merge branch 'master' into 2020-01-zr
This commit is contained in:
@@ -100,3 +100,25 @@ class: extra-details
|
||||
* In "Build rules" block near page bottom, put `/www` in "Build Context" column (or whichever directory the Dockerfile is in).
|
||||
* Click "Save and Build" to build the repository immediately (without waiting for a git push).
|
||||
* Subsequent builds will happen automatically, thanks to GitHub hooks.
|
||||
|
||||
---
|
||||
|
||||
## Building on the fly
|
||||
|
||||
- Some services can build images on the fly from a repository
|
||||
|
||||
- Example: [ctr.run](https://ctr.run/)
|
||||
|
||||
.exercise[
|
||||
|
||||
- Use ctr.run to automatically build a container image and run it:
|
||||
```bash
|
||||
docker run ctr.run/github.com/undefinedlabs/hello-world
|
||||
```
|
||||
|
||||
]
|
||||
|
||||
There might be a long pause before the first layer is pulled,
|
||||
because the API behind `docker pull` doesn't allow to stream build logs, and there is no feedback during the build.
|
||||
|
||||
It is possible to view the build logs by setting up an account on [ctr.run](https://ctr.run/).
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
|
||||
.exercise[
|
||||
|
||||
- Let's ping `1.1.1.1`, Cloudflare's
|
||||
[public DNS resolver](https://blog.cloudflare.com/announcing-1111/):
|
||||
- Let's ping the address of `localhost`, the loopback interface:
|
||||
```bash
|
||||
kubectl run pingpong --image alpine ping 1.1.1.1
|
||||
kubectl run pingpong --image alpine ping 127.0.0.1
|
||||
```
|
||||
|
||||
<!-- ```hide kubectl wait deploy/pingpong --for condition=available``` -->
|
||||
@@ -367,12 +366,12 @@ Let's leave `kubectl logs` running while we keep exploring.
|
||||
|
||||
## Various ways of creating resources
|
||||
|
||||
- `kubectl run`
|
||||
- `kubectl run`
|
||||
|
||||
- easy way to get started
|
||||
- versatile
|
||||
|
||||
- `kubectl create <resource>`
|
||||
- `kubectl create <resource>`
|
||||
|
||||
- explicit, but lacks some features
|
||||
- can't create a CronJob before Kubernetes 1.14
|
||||
@@ -516,15 +515,36 @@ class: extra-details
|
||||
|
||||
---
|
||||
|
||||
## Aren't we flooding 1.1.1.1?
|
||||
class: extra-details
|
||||
|
||||
- If you're wondering this, good question!
|
||||
## Party tricks involving IP addresses
|
||||
|
||||
- Don't worry, though:
|
||||
- It is possible to specify an IP address with less than 4 bytes
|
||||
|
||||
*APNIC's research group held the IP addresses 1.1.1.1 and 1.0.0.1. While the addresses were valid, so many people had entered them into various random systems that they were continuously overwhelmed by a flood of garbage traffic. APNIC wanted to study this garbage traffic but any time they'd tried to announce the IPs, the flood would overwhelm any conventional network.*
|
||||
(example: `127.1`)
|
||||
|
||||
(Source: https://blog.cloudflare.com/announcing-1111/)
|
||||
- Zeroes are then inserted in the middle
|
||||
|
||||
- It's very unlikely that our concerted pings manage to produce
|
||||
even a modest blip at Cloudflare's NOC!
|
||||
- As a result, `127.1` expands to `127.0.0.1`
|
||||
|
||||
- So we can `ping 127.1` to ping `localhost`!
|
||||
|
||||
(See [this blog post](https://ma.ttias.be/theres-more-than-one-way-to-write-an-ip-address/
|
||||
) for more details.)
|
||||
|
||||
---
|
||||
|
||||
class: extra-details
|
||||
|
||||
## More party tricks with IP addresses
|
||||
|
||||
- We can also ping `1.1`
|
||||
|
||||
- `1.1` will expand to `1.0.0.1`
|
||||
|
||||
- This is one of the addresses of Cloudflare's
|
||||
[public DNS resolver](https://blog.cloudflare.com/announcing-1111/)
|
||||
|
||||
- This is a quick way to check connectivity
|
||||
|
||||
(if we can reach 1.1, we probably have internet access)
|
||||
|
||||
@@ -89,3 +89,25 @@
|
||||
- When picking a registry, pay attention to its build system
|
||||
|
||||
(when it has one)
|
||||
|
||||
---
|
||||
|
||||
## Building on the fly
|
||||
|
||||
- Some services can build images on the fly from a repository
|
||||
|
||||
- Example: [ctr.run](https://ctr.run/)
|
||||
|
||||
.exercise[
|
||||
|
||||
- Use ctr.run to automatically build a container image and run it:
|
||||
```bash
|
||||
docker run ctr.run/github.com/jpetazzo/container.training/dockercoins/hasher
|
||||
```
|
||||
|
||||
]
|
||||
|
||||
There might be a long pause before the first layer is pulled,
|
||||
because the API behind `docker pull` doesn't allow to stream build logs, and there is no feedback during the build.
|
||||
|
||||
It is possible to view the build logs by setting up an account on [ctr.run](https://ctr.run/).
|
||||
Reference in New Issue
Block a user