mirror of
https://github.com/matter-labs/nixsgx.git
synced 2025-07-22 15:54:47 +02:00
feat(sgx): try to reduce the docker layers
Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
This commit is contained in:
parent
788ff52330
commit
2821ae4d91
1 changed files with 39 additions and 38 deletions
|
@ -97,9 +97,6 @@ let
|
||||||
tomlFormat = pkgs.formats.toml { };
|
tomlFormat = pkgs.formats.toml { };
|
||||||
manifestFile = tomlFormat.generate "${name}.manifest.toml" mergedManifest;
|
manifestFile = tomlFormat.generate "${name}.manifest.toml" mergedManifest;
|
||||||
|
|
||||||
contents = pkgs.buildEnv {
|
|
||||||
name = "image-root-${appName}";
|
|
||||||
|
|
||||||
paths = with pkgs.dockerTools; with nixsgx;[
|
paths = with pkgs.dockerTools; with nixsgx;[
|
||||||
openssl.out
|
openssl.out
|
||||||
curl.out
|
curl.out
|
||||||
|
@ -131,23 +128,27 @@ let
|
||||||
eval "${extraPostBuild}"
|
eval "${extraPostBuild}"
|
||||||
)
|
)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
contents = pkgs.buildEnv {
|
||||||
|
name = "image-root-${appName}";
|
||||||
|
inherit paths pathsToLink postBuild;
|
||||||
};
|
};
|
||||||
|
|
||||||
extendedContents = pkgs.buildEnv {
|
extendedContents = pkgs.buildEnv {
|
||||||
name = "extended-root-${appName}";
|
name = "extended-root-${appName}";
|
||||||
|
|
||||||
paths = with pkgs.dockerTools; with nixsgx;[
|
paths = paths ++ (with pkgs.dockerTools; with nixsgx;[
|
||||||
coreutils
|
coreutils
|
||||||
restart-aesmd
|
restart-aesmd
|
||||||
sgx-psw
|
sgx-psw
|
||||||
usrBinEnv
|
usrBinEnv
|
||||||
binSh
|
binSh
|
||||||
fakeNss
|
fakeNss
|
||||||
] ++ extendedPackages;
|
]) ++ extendedPackages;
|
||||||
|
|
||||||
pathsToLink = [ "/bin" "/lib" "/etc" "/share" ];
|
pathsToLink = pathsToLink ++ [ "/bin" "/lib" "/etc" "/share" ];
|
||||||
|
|
||||||
postBuild =
|
postBuild = postBuild + (
|
||||||
if sgx_default_qcnl_conf != null then ''
|
if sgx_default_qcnl_conf != null then ''
|
||||||
(
|
(
|
||||||
set -e
|
set -e
|
||||||
|
@ -155,7 +156,8 @@ let
|
||||||
rm -f $out/etc/sgx_default_qcnl.conf
|
rm -f $out/etc/sgx_default_qcnl.conf
|
||||||
ln -s ${sgx_default_qcnl_conf} $out/etc/sgx_default_qcnl.conf
|
ln -s ${sgx_default_qcnl_conf} $out/etc/sgx_default_qcnl.conf
|
||||||
)
|
)
|
||||||
'' else null;
|
'' else ""
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
@ -201,7 +203,6 @@ let
|
||||||
name = "${name}-manifest-${appName}";
|
name = "${name}-manifest-${appName}";
|
||||||
inherit tag;
|
inherit tag;
|
||||||
inherit contents;
|
inherit contents;
|
||||||
inherit fromImage;
|
|
||||||
inherit maxLayers;
|
inherit maxLayers;
|
||||||
|
|
||||||
includeStorePaths = false;
|
includeStorePaths = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue