Last active
October 17, 2017 14:55
-
-
Save teh/f3d8532bfef8fb25fe1f to your computer and use it in GitHub Desktop.
Create a an ACI image with tar, then run it with rkt.
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
{ | |
"acKind": "ImageManifest", | |
"acVersion": "0.7.0", | |
"name": "my-app", | |
"labels": [ | |
{"name": "os", "value": "linux"}, | |
{"name": "arch", "value": "amd64"} | |
], | |
"app": { | |
"exec": [ | |
"/nix/store/v9pq6f0s1r5fdybqc7pbv7mkb33lx9yy-python-2.7.10/bin/python2-config" | |
], | |
"user": "0", | |
"group": "0" | |
} | |
} |
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
tar --xform "s_nix/_rootfs/nix/_" \ | |
-czf image.aci \ | |
$(nix-store -qR /nix/store/v9pq6f0s1r5fdybqc7pbv7mkb33lx9yy-python-2.7.10) \ | |
manifest | |
sudo /home/tom/.nix-profile/bin/rkt run \ | |
--insecure-skip-verify \ | |
--no-overlay \ | |
--mds-register=false image.aci |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks, this is really cool. I tried converting it into something you could use in a derivation - I am certain this could be written better/more idiomatically, but here is what I came up with (which seems to work)
(for context, the derivation
jar
builds a java app and a shell script to start it)