teepot/packages/container-self-attestation-test-sgx-dcap/default.nix
Harald Hoyer 9680e32e82
fix: cleanup the nix packages
`curl` and `openssl` have to be specified with `.out`

Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
2024-03-08 14:19:31 +01:00

48 lines
1.2 KiB
Nix

# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2024 Matter Labs
{ pkgs
, nixsgx
, curl
, teepot
, bash
, coreutils
, openssl
}:
let manifest = ./tee-self-attestation-test.manifest.toml;
in pkgs.dockerTools.buildLayeredImage {
name = "teepot-self-attestation-test-sgx-dcap";
tag = "base";
config.Entrypoint = [ "/bin/sh" "-c" ];
contents = pkgs.buildEnv {
name = "image-root";
paths = with pkgs.dockerTools; with nixsgx;[
bash
coreutils
openssl.out
curl.out
teepot.teepot.tee_self_attestation_test
gramine
restart-aesmd
sgx-dcap.quote_verify
sgx-dcap.default_qpl
sgx-psw
usrBinEnv
binSh
caCertificates
fakeNss
];
pathsToLink = [ "/bin" "/lib" "/etc" "/share" "/app" ];
postBuild = ''
mkdir -p $out/{app,etc}
mkdir -p $out/app/{.dcap-qcnl,.az-dcap-client}
mkdir -p $out/var/run
mkdir -p $out/${nixsgx.sgx-psw.out}/aesm/
ln -s ${curl.out}/lib/libcurl.so $out/${nixsgx.sgx-psw.out}/aesm/
cp ${manifest} $out/app/tee-self-attestation-test.manifest.toml
printf "precedence ::ffff:0:0/96 100\n" > $out/etc/gai.conf
'';
};
}