-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (21 loc) · 912 Bytes
/
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
# ------------------------------------------------------------------------------
# Build Stage
# ------------------------------------------------------------------------------
FROM rust:latest as cargo-build
WORKDIR /usr/src/
COPY Cargo.toml Cargo.toml
RUN mkdir src/
COPY . .
RUN cargo build --release
# ------------------------------------------------------------------------------
# Packacge Stage
# ------------------------------------------------------------------------------
FROM ubuntu:latest
# create user to limit access in container
RUN groupadd -g 1001 json_rpc_snoop && useradd -r -u 1001 -g json_rpc_snoop json_rpc_snoop
RUN apt update && apt install -y libssl1.1="1.1.1f-1ubuntu2"
USER json_rpc_snoop
WORKDIR /home/json_rpc_snoop/bin/
COPY --from=cargo-build /usr/src/target/release/json_rpc_snoop .
RUN chown json_rpc_snoop:json_rpc_snoop /home/json_rpc_snoop/bin/
ENTRYPOINT [""]