Last active
July 21, 2019 03:41
-
-
Save Pitometsu/755bc7312fbed98451c7320957b1f053 to your computer and use it in GitHub Desktop.
Nix /home to docker installation problem
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
mypkg = mkDerivation rec { | |
name = "mypkg"; | |
version = "0.0.1"; | |
src = ./.; | |
# ... | |
outputs = [ "out" "custom" ]; | |
installPhase = '' | |
mkdir -p $out | |
do-some-install-to $out | |
mkdir -pv $custom/share | |
cp -dR --preserve=mode,timestamps from-sources-share \ | |
$custom/share/custom/ | |
mkdir -p "$custom/home/custom" | |
ln -Tsv $custom/share "$custom/home/custom/share" | |
''; | |
} | |
let | |
image = with dockerTools.buildLayeredImage { | |
name = mypkg.name; | |
tag = mypkg.version; | |
contents = [ mypkg.all ]; | |
created = "now"; | |
config = { | |
Entrypoint = [ "myapp" ]; | |
ExposedPorts = { | |
"4000/tcp" = {}; | |
}; | |
}; | |
} | |
in image |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently
$custom
have such output:But I see only
/share
linked to dockers root at result docker image.