Files
lxd-profiles/demo/docker/usage.yaml
T
xavierandClaude Opus 5.5 372bf5d84b docs: Docker tutorial with recorded demos (demo/docker)
- demo/docker/README.md (fr) and README.en.md: step-by-step tutorial, from
  the clone of the repository to Docker used in an unprivileged LXD instance
- install and usage scenarios recorded with autocast, with their own hidden
  preamble (demo/docker/setup.sh) creating and removing what they need
- demo/castfix.py: puts back the shell prompt autocast drops and squeezes the
  cloud-init progress dots
- Tutorials section in the main READMEs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJkPw1qcoCubeKqfffm
2026-11-21 18:39:35 +01:00

45 lines
1.7 KiB
YAML

# Demo: using Docker in the LXD instance, with lxc exec then from a shell in the instance
# (prerequisites: LXD, mise; instance "docker" created with its profile if missing, then removed at the end)
settings:
width: 156
height: 36
type_speed: 35ms
# Empty: the prompts are the shell's own (PS1), so that the instance's root shell keeps its own prompt
prompt: ""
timeout: 300s
# bash without rc files: the real prompt (PS1) is used to detect the end of commands
shell:
program: bash
args: [--norc, --noprofile]
prompt: AUTOCAST_PROMPT
line_split: " \\"
quit_command: exit
environment:
- {name: PS1, value: "\\[\\e[1;34m\\]lxd\\[\\e[0m\\] > AUTOCAST_PROMPT"}
- {name: PROMPT_COMMAND, value: "bind 'set enable-bracketed-paste off'"}
- {name: TERM, value: xterm-256color}
instructions:
- !Command {command: "source demo/docker/setup.sh usage", hidden: true}
- !Marker Exec
- !Command {command: "# Run a command in the instance from the host"}
- !Command {command: "lxc exec docker -- docker run --rm hello-world"}
- !Wait 4s
- !Clear
- !Marker Shell
- !Command {command: "# Or open a shell in the instance and use Docker as on any machine"}
- !Command {command: "lxc shell docker"}
- !Command {command: "docker run -d --name web -p 8080:80 nginx:alpine"}
- !Wait 2s
- !Command {command: "clear"}
- !Command {command: "docker image ls"}
- !Command {command: "docker ps"}
- !Wait 3s
- !Command {command: "docker top web -o pid,user,args"}
- !Command {command: "docker stats --no-stream"}
- !Wait 3s
- !Command {command: "curl -s localhost:8080 | grep title"}
- !Command {command: "exit"}
- !Wait 5s
- !Command {command: "demo_cleanup", hidden: true}