-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (25 loc) · 1.03 KB
/
Copy pathDockerfile
File metadata and controls
37 lines (25 loc) · 1.03 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
FROM rust:1.88-alpine@sha256:9dfaae478ecd298b6b5a039e1f2cc4fc040fc818a2de9aa78fa714dea036574d AS builder
# specify rust features
ARG FEATURES="default"
# specify our build directory
WORKDIR /usr/src/passage
# copy the source files into the engine
COPY . .
# install dev dependencies and perform build process
RUN set -eux \
&& apk add --no-cache libressl-dev musl-dev protobuf-dev protoc \
&& cargo build --release --features "${FEATURES}"
FROM scratch
# declare our minecraft and metrics ports
EXPOSE 25565
# copy the ssl certificates
COPY --from=builder "/etc/ssl/certs/ca-certificates.crt" "/etc/ssl/certs/ca-certificates.crt"
# copy the raw binary into the new image
COPY --from=builder "/usr/src/passage/target/release/passage" "/passage"
# copy the users and groups for the nobody user and group
COPY --from=builder "/etc/passwd" "/etc/passwd"
COPY --from=builder "/etc/group" "/etc/group"
# we run with minimum permissions as the nobody user
USER nobody:nobody
# just execute the raw binary without any wrapper
ENTRYPOINT ["/passage"]