Hands on 1 - Discovering
The goal of this hands-on is to:
- Locally run a Flatcar instance
- Boot the instance and SSH into
- Run Nginx container on the instance
Step-by-step
Create a working directory:
mkdir flatcar; cd flatcar
Get the qemu helper:
wget https://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_qemu.sh
Get the latest stable release for qemu:
wget https://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_qemu_image.img
Create a backup to always have a fresh image around:
mv flatcar_production_qemu_image.img flatcar_production_qemu_image.img.fresh
Make the qemu helper executable:
chmod +x flatcar_production_qemu.sh
Before starting, make sure you boot a fresh image:
cp -i --reflink=auto flatcar_production_qemu_image.img.fresh flatcar_production_qemu_image.img
Starts the flatcar image in console mode:
./flatcar_production_qemu.sh -- -display curses
NOTE: it’s possible to connect to the instance via SSH:
$ cat ~/.ssh/config
Host flatcar
User core
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
HostName 127.0.0.1
Port 2222
$ ssh flatcar
Once on the instance, you can try things and run a docker image:
docker run --rm -p 80:80 -d nginx
Assert it works:
curl localhost
Resources
Demo
- Video with timestamp: https://youtu.be/woZlGiLsKp0?t=472
- Asciinema: https://asciinema.org/a/591438