-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
65 lines (49 loc) · 1.5 KB
/
Dockerfile
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
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM ubuntu:22.04 AS builder
LABEL version="4.19.3"
LABEL name="Cosmian KMS docker container"
ENV DEBIAN_FRONTEND=noninteractive
ENV OPENSSL_DIR=/usr/local/openssl
WORKDIR /root
RUN apt-get update \
&& apt-get install --no-install-recommends -qq -y \
curl \
build-essential \
libssl-dev \
ca-certificates \
libclang-dev \
libsodium-dev \
pkg-config \
git \
wget \
&& apt-get -y -q upgrade \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain "nightly-x86_64-unknown-linux-gnu"
COPY . /root/kms
WORKDIR /root/kms
RUN mkdir -p $OPENSSL_DIR \
&& bash /root/kms/.github/scripts/local_ossl_instl.sh $OPENSSL_DIR
RUN /root/.cargo/bin/cargo build --release --no-default-features
#
# KMS Server
#
FROM ubuntu:22.04 AS kms
ENV DEBIAN_FRONTEND=noninteractive
ENV OPENSSL_DIR=/usr/local/openssl
RUN apt-get update \
&& apt-get install --no-install-recommends -qq -y \
ca-certificates \
libssl-dev \
libsodium-dev \
&& apt-get -y -q upgrade \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /root/kms/target/release/cosmian_kms_server /usr/bin/cosmian_kms_server
COPY --from=builder /root/kms/target/release/ckms /usr/bin/ckms
COPY --from=builder $OPENSSL_DIR/lib64/ossl-modules/legacy.so $OPENSSL_DIR/lib64/ossl-modules/legacy.so
#
# Create working directory
#
WORKDIR /data
EXPOSE 9998
ENTRYPOINT ["cosmian_kms_server"]