forked from Cosmian/kms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (44 loc) · 1.25 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
FROM ubuntu:22.04 as builder
LABEL version="4.16.0"
LABEL name="Cosmian KMS docker container"
ARG FEATURES
ENV DEBIAN_FRONTEND=noninteractive
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 \
&& 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 /root/.cargo/bin/cargo build --release --no-default-features ${FEATURES}
#
# KMS Server
#
FROM ubuntu:22.04 as kms
ENV DEBIAN_FRONTEND=noninteractive
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
#
# Create working directory
#
WORKDIR /data
EXPOSE 9998
ENTRYPOINT ["cosmian_kms_server"]