|
@ -44,7 +44,8 @@ ENV DEBIAN_FRONTEND=noninteractive \ |
|
|
RUN --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/root/.cargo/registry mkdir -pv "${CARGO_HOME}" \ |
|
|
RUN --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/root/.cargo/registry mkdir -pv "${CARGO_HOME}" \ |
|
|
&& rustup set profile minimal |
|
|
&& rustup set profile minimal |
|
|
|
|
|
|
|
|
ENV RUSTFLAGS='-C link-arg=-s' |
|
|
# To be able to build the armv6 image with mimalloc we need to specifically specify the libatomic.a file location |
|
|
|
|
|
ENV RUSTFLAGS='-Clink-arg=/usr/local/musl/arm-unknown-linux-musleabi/lib/libatomic.a' |
|
|
|
|
|
|
|
|
# Creates a dummy project used to grab dependencies |
|
|
# Creates a dummy project used to grab dependencies |
|
|
RUN USER=root cargo new --bin /app |
|
|
RUN USER=root cargo new --bin /app |
|
@ -58,7 +59,8 @@ COPY ./build.rs ./build.rs |
|
|
RUN --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/root/.cargo/registry rustup target add arm-unknown-linux-musleabi |
|
|
RUN --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/root/.cargo/registry rustup target add arm-unknown-linux-musleabi |
|
|
|
|
|
|
|
|
# Configure the DB ARG as late as possible to not invalidate the cached layers above |
|
|
# Configure the DB ARG as late as possible to not invalidate the cached layers above |
|
|
ARG DB=sqlite,mysql,postgresql |
|
|
# Enable MiMalloc to improve performance on Alpine builds |
|
|
|
|
|
ARG DB=sqlite,mysql,postgresql,enable_mimalloc |
|
|
|
|
|
|
|
|
# Builds your dependencies and removes the |
|
|
# Builds your dependencies and removes the |
|
|
# dummy project, except the target folder |
|
|
# dummy project, except the target folder |
|
|