-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile.kbs
More file actions
42 lines (28 loc) · 1.14 KB
/
Dockerfile.kbs
File metadata and controls
42 lines (28 loc) · 1.14 KB
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
ARG BASE_IMAGE=alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3:latest
FROM ${BASE_IMAGE} AS builder
ARG ALL_PROXY
ARG NO_PROXY
ENV ALL_PROXY=$ALL_PROXY
ENV NO_PROXY=$NO_PROXY
ARG CARGO_JOBS
ARG ARCH=x86_64
ARG HTTPS_CRYPTO=rustls
ARG ALIYUN=true
ARG TPM_PCA_PLUGIN=true
ARG ENCRYPTED_LOCAL_FS=true
WORKDIR /usr/src/kbs
COPY . .
RUN yum install -y cargo curl clang perl protobuf-devel git libgudev-devel openssl-devel
RUN sed -i 's/version = 4/version = 3/g' Cargo.lock
RUN if [ -n "$CARGO_JOBS" ]; then \
[ ! -d /root/.cargo ] && mkdir /root/.cargo; \
echo -e "[build]\njobs = $CARGO_JOBS" >> /root/.cargo/config.toml; \
fi
# Build and Install KBS
RUN cd kbs && make AS_FEATURE=coco-as-grpc ALIYUN=${ALIYUN} TPM_PCA_PLUGIN=${TPM_PCA_PLUGIN} ENCRYPTED_LOCAL_FS=${ENCRYPTED_LOCAL_FS} && \
make install-kbs
FROM ${BASE_IMAGE}
RUN yum install -y openssl curl pkg-config
COPY --from=builder /usr/local/bin/kbs /usr/local/bin/kbs
COPY --from=builder /usr/src/kbs/kbs/kbs-init/kbs-init /usr/local/bin/coco-kbs-init
COPY --from=builder /usr/src/kbs/kbs/kbs-init/kbs-watcher /usr/local/bin/coco-kbs-secret-watcher