Last active
December 4, 2018 17:33
-
-
Save grahamc/5333e12cf813c81a481c6852e0acf072 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
let pkgs = import <nixpkgs> {}; in | |
# 11. Create an image on top of a layered image | |
pkgs.dockerTools.buildImage { | |
name = "mutable-directory"; | |
tag = "latest"; | |
extraCommands = '' | |
mkdir ./example-output | |
chmod 777 ./example-output | |
''; | |
config.Cmd = [ "${pkgs.bash}/bin/bash" | |
"-c" "export PATH=${pkgs.coreutils}/bin/; mkdir /example-output/hi-there; ls -la /; ls -la /example-output"]; | |
} | |
# nix-build ./example.nix && docker load < ./result && docker run --user 1000:1000 -it --rm mutable-directory:latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment