From 6f2eb093aa99d1297dba939a3d24aaef44e3b2d2 Mon Sep 17 00:00:00 2001 From: Eric Ernst Date: Mon, 10 Nov 2025 10:31:43 -0500 Subject: [PATCH] Create lab.md (#392) --- examples/ctr-example/lab.md | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 examples/ctr-example/lab.md diff --git a/examples/ctr-example/lab.md b/examples/ctr-example/lab.md new file mode 100644 index 00000000..2f1f9d9e --- /dev/null +++ b/examples/ctr-example/lab.md @@ -0,0 +1,48 @@ +# + +## Install and test the container tool: + +See https://github.com/apple/container/releases + +Once installed, start the service and follow prompts. + +```bash +container system start +``` + +This'll install your kernel. + +After this start your first container. On first launch, this'll install another artifact for our guest init process: + +``` +container run -it alpine sh +``` + +Container starts after this will be fast! + + +## Get the Containerization sources: + +```bash +$ git clone git@github.com:apple/containerization.git +``` + +## Take a look at ctr-example + +Read through the sources: + +- ContainerManager: +- manager.create() +- container.create(), start(), wait(), stop() + +## Build and run the example + +```bash +$ make +$ ./ctr-example +``` +## Modify the project + +- Change the command run by the container +- Change the image +