-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (29 loc) · 1009 Bytes
/
Dockerfile
File metadata and controls
36 lines (29 loc) · 1009 Bytes
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 --platform=${BUILDPLATFORM} alpine:edge AS builder
ENV PATH="$PATH:/mise/shims"
ENV MISE_DATA_DIR=/mise
ENV MISE_CONFIG_DIR=/mise
ENV MISE_CACHE_DIR=/cache/mise
RUN apk add --no-cache mise build-base
WORKDIR /
ADD mise.toml .
RUN --mount=type=cache,target=${MISE_CACHE_DIR} \
--mount=type=cache,target=/root/.rustup \
mise trust && mise install
ARG TARGETARCH
ENV TARGETARCH=${TARGETARCH}
WORKDIR /build
RUN --mount=type=bind,source=docker,target=docker \
--mount=type=bind,source=src,target=src \
--mount=type=bind,source=Cargo.toml,target=Cargo.toml \
--mount=type=bind,source=Cargo.lock,target=Cargo.lock \
--mount=type=cache,target=/build/target/ \
--mount=type=cache,target=/root/.rustup \
--mount=type=cache,target=/usr/local/cargo/git/db \
--mount=type=cache,target=/usr/local/cargo/registry/ \
sh docker/build.sh
FROM scratch AS wgexporter
WORKDIR /app
COPY --from=builder /out/wgexporter /app/
VOLUME [ "/app/data" ]
WORKDIR /app/data
ENTRYPOINT [ "/app/wgexporter" ]