aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
blob: 454a7599a4b3e5ec1c5d7a060956f67ca10f22dd (plain) (blame)
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
FROM rust:1.58 as builder

# Install and configure dependencies needed for building for musl target
RUN rustup target add x86_64-unknown-linux-musl
RUN apt update && apt install -y musl-tools musl-dev
RUN update-ca-certificates

# Add source code to image
WORKDIR /usr/src/rss-watcher
COPY . .

# Build
RUN cargo build --target x86_64-unknown-linux-musl --release

# Move to a smaller image
FROM scratch

# Copy binary from builder
COPY --from=builder /usr/src/rss-watcher/target/x86_64-unknown-linux-musl/release/rss-watcher /rss-watcher

# Add log level info, if we don't do this, no logs will be written
ENV RUST_LOG=info

# Start target
CMD ["/rss-watcher"]