Skip to content

Instantly share code, notes, and snippets.

@fionn
Last active April 30, 2020 15:30
Show Gist options
  • Save fionn/dffb4ddbc3e06136bf36ecf5b6c48ed4 to your computer and use it in GitHub Desktop.
Save fionn/dffb4ddbc3e06136bf36ecf5b6c48ed4 to your computer and use it in GitHub Desktop.
Simple Container

Simple Container

Dependencies

runc, skopeo and umoci.

Building

make all and be prepared to enter your password.

Entering the Container

Run

runc run test

as root and you'll be dropped into a busybox shell with a minimal filesystem.

.PHONY: all
all: config.json rootfs
config.json:
sudo runc spec
busybox:
skopeo copy docker://busybox:latest oci:busybox:latest
bundle: busybox
sudo umoci unpack --image busybox:latest bundle
rootfs: bundle
sudo cp -r bundle/rootfs .
.PHONY: clean
clean:
rm -r busybox
sudo rm -r rootfs
sudo rm -r bundle
sudo rm config.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment