-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
31 lines (25 loc) · 986 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
# syntax = docker/dockerfile:1.4
FROM rust:1.61.0-slim-bullseye AS builder
WORKDIR /app
COPY . .
RUN --mount=type=cache,target=/app/target \
--mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/usr/local/rustup \
set -eux; \
rustup install stable; \
cargo build --release; \
objcopy --compress-debug-sections target/release/well-written-server ./well-written-server
################################################################################
FROM debian:11.3-slim
RUN set -eux; \
export DEBIAN_FRONTEND=noninteractive; \
apt update; \
apt install --yes --no-install-recommends bind9-dnsutils iputils-ping iproute2 curl ca-certificates htop; \
apt clean autoclean; \
apt autoremove --yes; \
rm -rf /var/lib/{apt,dpkg,cache,log}/; \
echo "Installed base utils!"
WORKDIR app
COPY --from=builder /app/well-written-server ./well-written-server
CMD ["./well-written-server"]