Last active
January 7, 2017 09:56
-
-
Save DJviolin/497cba48b32eced5156c67c6cbcbc2bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 <[email protected]>" | |
} | |
] | |
} | |
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