-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
35 lines (24 loc) · 818 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
FROM ekidd/rust-musl-builder as builder
USER rust
COPY . /home/rust/src
# Need to have the rust user own our copied source files
RUN sudo chown -R rust . &&\
cargo build --release --verbose
FROM alpine
ARG VCS_REF
ARG CA_CERT
ARG BUILD_DATE
LABEL org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/lloydmeta/rusqbin" \
org.label-schema.build-date=$BUILD_DATE
COPY $CA_CERT /etc/ssl/certs/
COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/rusqbin /rusqbin
COPY entry.sh /entry.sh
RUN addgroup -S rusqbinuser &&\
adduser -S -g rusqbinuser rusqbinuser &&\
chown -R rusqbinuser /etc/ssl/certs/ &&\
chown rusqbinuser /rusqbin &&\
chown rusqbinuser /entry.sh
USER rusqbinuser
EXPOSE 9999
ENTRYPOINT ["/entry.sh", "/rusqbin"]