Files
linuxkit/docs/containerd.md
Justin Cormack 89e98eefa0 Shift to development track containerd
Move to the development track of `containerd` not the legacy 0.2
branch. The commands have changed a bit.

This does increase the image size as we are bundling the Docker
copy and our copy, and the new one is larger as it is growing features.
Hopefully Docker will shrink eventually. Also we may replace `ctr`
with a library.

Fix #1029

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-01-24 15:39:44 +00:00

982 B

Using the system containerd

Here is a simple example script that will run a container using the system containerd.

You should run it from /var as the root filesystem is in RAM, and will use up memory.

#!/bin/sh

NAME=nginx
VERSION=latest

docker pull ${NAME}:${VERSION}
CONTAINER=$(docker create --net=host --security-opt apparmor=unconfined --cap-drop all --cap-add net_bind_service --oom-score-adj=-500 -v /var/log/nginx:/var/log/nginx -v /var/cache/nginx:/var/cache/nginx -v /var/run:/var/run ${NAME}:${VERSION})
docker run -v ${PWD}:/conf -v /var/run/docker.sock:/var/run/docker.sock --rm jess/riddler -f -bundle /conf ${CONTAINER}
rm -rf rootfs && mkdir rootfs
docker export ${CONTAINER} | tar -C rootfs -xf -
docker rm ${CONTAINER}

mkdir -p /var/log/nginx /var/cache/nginx

ctr run --bundle . ${NAME}
ctr list

For production, you will want to create the config.json offline and bundle it in with your init script, but you can create the rootfs online.