-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (26 loc) · 1.04 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
# `DOCKER_BUILDKIT=1 docker build .`
#------------------------------------------------------------------------------
# Build Stage
#------------------------------------------------------------------------------
FROM ekidd/rust-musl-builder:latest AS builder
WORKDIR ./
# Download and compile dependencies
RUN USER=root cargo new --bin rustfm-scraper
WORKDIR ./rustfm-scraper
COPY Cargo.toml Cargo.lock ./
RUN cargo build --release
# Build the exe using actual source code
COPY src ./src
RUN cargo build --release
#------------------------------------------------------------------------------
# Final Stage
#------------------------------------------------------------------------------
FROM alpine:latest
# Install ca-certificates for openssl
RUN apk --no-cache add ca-certificates
#COPY --from=builder /usr/local/cargo/bin/rustfm-scraper .
COPY --from=builder \
/home/rust/src/rustfm-scraper/target/x86_64-unknown-linux-musl/release/rustfm-scraper \
/usr/local/bin
USER 1000
CMD /usr/local/bin/rustfm-scraper