forked from confidential-containers/trustee
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.as-restful
52 lines (35 loc) · 2.13 KB
/
Dockerfile.as-restful
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Copyright (c) 2023 by Alibaba.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
FROM rust:latest as builder
WORKDIR /usr/src/attestation-service
COPY . .
# Install golang
RUN wget https://go.dev/dl/go1.20.1.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go1.20.1.linux-amd64.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"
# Install TPM Build Dependencies
RUN apt-get update && apt-get install -y protobuf-compiler clang libtss2-dev
# Install TDX Build Dependencies
RUN curl -L https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | tee intel-sgx-deb.key | apt-key add - && \
echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu focal main' | tee /etc/apt/sources.list.d/intel-sgx.list && \
apt-get update && apt-get install -y libtdx-attest-dev libsgx-dcap-quote-verify-dev
# Build and Install RESTful attestation-service
RUN cargo install --path attestation-service/attestation-service --bin restful-as --features restful-bin --locked
FROM ubuntu:22.04
LABEL org.opencontainers.image.source="https://github.com/confidential-containers/attestation-service"
# Install TDX Runtime Dependencies
RUN apt-get update && apt-get install curl gnupg openssl -y && \
rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
RUN curl -L https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | tee intel-sgx-deb.key | apt-key add - && \
echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu focal main' | tee /etc/apt/sources.list.d/intel-sgx.list && \
apt-get update && \
apt-get install -y libsgx-dcap-default-qpl libsgx-dcap-quote-verify && \
rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
# Copy TPM Runtime Dependencies
COPY --from=builder /usr/lib/x86_64-linux-gnu/libtss* /usr/lib/x86_64-linux-gnu
COPY --from=builder /usr/local/cargo/bin/restful-as /usr/local/bin/restful-as
COPY ./attestation-service/config.json /etc/config.json
VOLUME /opt/confidential-containers/attestation-service
CMD ["restful-as", "--socket", "0.0.0.0:8080", "--config-file", "/etc/config.json"]
EXPOSE 8080