diff --git a/examples/ctr-example/Makefile b/examples/ctr-example/Makefile index 2a1ea5fb..f79f220b 100644 --- a/examples/ctr-example/Makefile +++ b/examples/ctr-example/Makefile @@ -18,7 +18,7 @@ SWIFT = /usr/bin/swift .PHONY: all build clean run -all: containerization run +all: run build: $(SWIFT) build --configuration release @@ -39,10 +39,6 @@ debug: fmt: $(SWIFT) format --in-place --recursive Sources/ - -containerization: - $(MAKE) -C ../.. all - fetch-default-kernel: $(MAKE) -C ../.. fetch-default-kernel cp -L ../../.local/vmlinux ./vmlinux diff --git a/examples/ctr-example/README.md b/examples/ctr-example/README.md index 44df1e11..05873bca 100644 --- a/examples/ctr-example/README.md +++ b/examples/ctr-example/README.md @@ -24,6 +24,7 @@ After the build completes, the example will run. In your terminal you should see ``` Starting container example... +Fetching container initial filesystem... Creating container from docker.io/library/alpine:3.16... Starting container... / # diff --git a/examples/ctr-example/Sources/ctr-example/main.swift b/examples/ctr-example/Sources/ctr-example/main.swift index a32935f4..cf8df300 100644 --- a/examples/ctr-example/Sources/ctr-example/main.swift +++ b/examples/ctr-example/Sources/ctr-example/main.swift @@ -28,10 +28,12 @@ struct CtrExample { try current.setraw() defer { current.tryReset() } + let initfsReference = "ghcr.io/apple/containerization/vminit:0.13.0" + print("Fetching base container filesystem...") // Create container manager with file-based initfs var manager = try await ContainerManager( kernel: Kernel(path: URL(fileURLWithPath: "./vmlinux"), platform: .linuxArm), - initfsReference: "vminit:latest", + initfsReference: initfsReference, network: try ContainerManager.VmnetNetwork() )