-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile.as-grpc
43 lines (30 loc) · 1.73 KB
/
Dockerfile.as-grpc
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
# syntax=docker/dockerfile:1.3
# Copyright (c) 2023 by Alibaba.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
ARG BASE_IMAGE=eci-nydus-registry.cn-hangzhou.cr.aliyuncs.com/docker/debian:stable-slim
FROM ${BASE_IMAGE} AS builder
ARG ARCH=x86_64
WORKDIR /tmp
RUN apt update && apt install -y gcc perl wget make gnupg openssl curl protobuf-compiler git clang libtss2-dev libudev-dev pkg-config && \
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 jammy main' | tee /etc/apt/sources.list.d/intel-sgx.list && \
apt-get update && apt-get install -y libsgx-dcap-quote-verify-dev
WORKDIR /usr/src/attestation-service
COPY . .
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Build and Install gRPC attestation-service
RUN cargo install --path attestation-service --bin grpc-as --features grpc-bin --locked
FROM ${BASE_IMAGE}
ARG ARCH=x86_64
WORKDIR /tmp
RUN apt update && apt install -y libtss2-dev curl gnupg openssl && \
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 jammy 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
COPY --from=builder /root/.cargo/bin/grpc-as /usr/local/bin/grpc-as
VOLUME /opt/confidential-containers/attestation-service
CMD ["grpc-as", "--socket", "0.0.0.0:50004"]
EXPOSE 50004