Skip to content

Instantly share code, notes, and snippets.

@DJviolin
Last active January 7, 2017 09:56
Show Gist options
  • Save DJviolin/497cba48b32eced5156c67c6cbcbc2bf to your computer and use it in GitHub Desktop.
Save DJviolin/497cba48b32eced5156c67c6cbcbc2bf to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
# create ACI with trusty without actool due to bug https://github.com/coreos/rocket/issues/198
# https://gist.github.com/brosner/dbc092e3024f6a80149b
# $ ./debian-aci-creator.sh
# $ cd /var/lib/container/aci
# $ zcat debian.aci | tree | head
# $ rkt run debian.aci --insecure-options=image --interactive --exec=/bin/bash
export MY_CHROOT=/var/lib/container/aci/debian
mkdir -p $MY_CHROOT
cd $MY_CHROOT
debootstrap --arch=amd64 --include=iputils-ping,iproute --variant=minbase stable rootfs http://httpredir.debian.org/debian
cat > manifest <<EOF
{
"acKind": "ImageManifest",
"acVersion": "0.8.9",
"name": "debian",
"labels": [
{"name": "arch", "value": "amd64"},
{"name": "os", "value": "linux"},
{"name": "version", "value": "1.0.0"}
],
"app": {
"exec": [
"/bin/sh",
"echo",
"Hello, World from \$MY_ENV_VAR!"
],
"user": "0",
"group": "0",
"workingDirectory": "/mnt",
"environment": [
{
"name": "MY_ENV_VAR",
"value": "\$(whoami)"
}
],
"ports": [
{
"name": "http",
"port": 80,
"protocol": "tcp",
"socketActivated": true
}
]
},
"annotations": [
{
"name": "authors",
"value": "Istvan Lantos <kerozin.joe@gmail.com>"
}
]
}
EOF
tar cvf - manifest rootfs | gzip -c > debian.aci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment