Replace /bin/sh, /usr/bin/env mounts by symlinks
This makes the arion-base image compatible with hosts other than NixOS.
This commit is contained in:
parent
bb5a8810e8
commit
89f5622f2e
5 changed files with 6 additions and 3 deletions
|
@ -11,6 +11,7 @@ stdenv.mkDerivation {
|
||||||
mkdir -p $out/bin $out/share/arion
|
mkdir -p $out/bin $out/share/arion
|
||||||
cp -a nix $out/share/arion/
|
cp -a nix $out/share/arion/
|
||||||
cp -a arion-image $out/share/arion/
|
cp -a arion-image $out/share/arion/
|
||||||
|
tar -czf $out/share/arion/arion-image/tarball.tar.gz -C arion-image/tarball .
|
||||||
substitute arion $out/bin/arion \
|
substitute arion $out/bin/arion \
|
||||||
--subst-var-by path ${lib.makeBinPath [jq coreutils docker_compose]} \
|
--subst-var-by path ${lib.makeBinPath [jq coreutils docker_compose]} \
|
||||||
--subst-var-by nix_dir $out/share/arion/nix \
|
--subst-var-by nix_dir $out/share/arion/nix \
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY passwd /etc/passwd
|
COPY passwd /etc/passwd
|
||||||
|
ADD tarball.tar.gz /
|
||||||
|
|
1
src/arion-image/tarball/bin/sh
Symbolic link
1
src/arion-image/tarball/bin/sh
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
/run/system/bin/sh
|
1
src/arion-image/tarball/usr/bin/env
Symbolic link
1
src/arion-image/tarball/usr/bin/env
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
/run/system/usr/bin/env
|
|
@ -4,7 +4,7 @@
|
||||||
when the service.useHostStore option is set to true.
|
when the service.useHostStore option is set to true.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
{ lib, config, ... }:
|
{ lib, config, pkgs, ... }:
|
||||||
let
|
let
|
||||||
inherit (lib) mkOption types mkIf;
|
inherit (lib) mkOption types mkIf;
|
||||||
in
|
in
|
||||||
|
@ -21,8 +21,7 @@ in
|
||||||
service.build.context = "${../arion-image}";
|
service.build.context = "${../arion-image}";
|
||||||
service.volumes = [
|
service.volumes = [
|
||||||
"/nix/store:/nix/store"
|
"/nix/store:/nix/store"
|
||||||
"/bin/sh:/bin/sh"
|
"${pkgs.buildEnv { name = "container-system-env"; paths = [ pkgs.bashInteractive pkgs.coreutils ]; }}:/run/system"
|
||||||
"/usr/bin/env:/usr/bin/env"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue