-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
38 lines (31 loc) · 1.05 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
FROM registry.access.redhat.com/ubi8/ubi-minimal as builder
USER root
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.50.0
# Apply security patches
RUN set -xe; \
microdnf update -y && \
microdnf clean all && rm -rf /var/cache/yum && \
microdnf install gcc-c++ gcc openssl openssl-devel python2
RUN set -xue; \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh; \
chmod +x ./rustup.sh && \
./rustup.sh -v --no-modify-path --default-toolchain ${RUST_VERSION} -y --profile minimal && \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
cargo --version; \
rustc --version; \
rustup component add rustfmt
WORKDIR /src
COPY . .
RUN cargo install --path .
FROM registry.access.redhat.com/ubi8/ubi-minimal
# Apply security patches
RUN set -xe; \
microdnf update -y && \
microdnf clean all && rm -rf /var/cache/yum
COPY --from=builder /usr/local/cargo/bin/fortuna /usr/local/bin/fortuna
USER 1001
CMD ["fortuna"]