-
Notifications
You must be signed in to change notification settings - Fork 35
/
Dockerfile
36 lines (30 loc) · 1.01 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
36
FROM rust:1.80.1-bookworm AS build
WORKDIR /src
RUN set -xe; \
mkdir -p /target/etc; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
tzdata \
wget \
xz-utils \
musl-dev \
musl-tools \
patch \
git; \
git clone https://github.com/fbergen/findtime.git; \
cd findtime; \
git checkout f1c97c2; \
ln -sf ../usr/share/zoneinfo/Etc/UTC /target/etc/localtime; \
echo "Etc/UTC" > /target/etc/timezone;
WORKDIR /src/findtime
RUN set -xe; \
rustup target add x86_64-unknown-linux-musl; \
cargo build --release --target=x86_64-unknown-linux-musl \
;
FROM scratch
COPY --from=build /target/etc /etc
COPY --from=build /usr/share/zoneinfo/Etc/UTC /usr/share/zoneinfo/Etc/UTC
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /src/findtime/target/x86_64-unknown-linux-musl/release/findtime /findtime
COPY --from=build /src/findtime/index.html /src/findtime/main.js /