-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile
33 lines (22 loc) · 883 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
32
33
# syntax=docker/dockerfile:experimental
FROM debian:buster-slim
ENV DEBIAN_FRONTEND noninteractive
ARG HTTPS_PROXY
ARG HTTP_PROXY
ENV http_proxy $HTTP_PROXY
ENV https_proxy $HTTPS_PROXY
RUN apt-get update && apt-get install build-essential curl git pkg-config libfuse-dev fuse -y && rm -rf /var/lib/apt/lists/*
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain nightly-2021-12-23 -y
ENV PATH "/root/.cargo/bin:${PATH}"
RUN if [ -n "$HTTP_PROXY" ]; then echo "[http]\n\
proxy = \"${HTTP_PROXY}\"\n\
"\
> /root/.cargo/config ; fi
COPY . /toda-build
WORKDIR /toda-build
ENV RUSTFLAGS "-Z relro-level=full"
RUN --mount=type=cache,target=/toda-build/target \
--mount=type=cache,target=/root/.cargo/registry \
cargo build --release
RUN --mount=type=cache,target=/toda-build/target \
cp /toda-build/target/release/toda /toda