teepot/packages/container-self-attestation-test-sgx-azure/Dockerfile
Harald Hoyer 284393bf76
fix: only restart aesmd if aesm.socket is not readable
Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
2024-05-21 13:41:08 +02:00

23 lines
860 B
Docker

# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2024 Matter Labs
FROM teepot-self-attestation-test-sgx-azure:base
WORKDIR /app
COPY packages/container-vault-sgx-azure/test-enclave-key.pem /tmp/
RUN set -eux; \
gramine-manifest -Darch_libdir=/lib/x86_64-linux-gnu \
-Dentrypoint=$(readlink /bin/tee-self-attestation-test) \
-Dexecdir=/bin \
-Dlog_level=error \
tee-self-attestation-test.manifest.toml tee-self-attestation-test.manifest; \
gramine-sgx-sign --manifest tee-self-attestation-test.manifest --output tee-self-attestation-test.manifest.sgx --key /tmp/test-enclave-key.pem; \
rm /tmp/test-enclave-key.pem
EXPOSE 8443
ENTRYPOINT ["/bin/sh", "-c"]
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt
CMD [ "[[ -r /var/run/aesmd/aesm.socket ]] || restart-aesmd >&2; exec gramine-sgx tee-self-attestation-test" ]