1# syntax=docker/dockerfile:1
 2
 3ARG BASE_IMAGE
 4FROM ${BASE_IMAGE}
 5WORKDIR /app
 6ARG TZ=Etc/UTC \
 7    LANG=C.UTF-8 \
 8    LC_ALL=C.UTF-8 \
 9    DEBIAN_FRONTEND=noninteractive
10ENV CARGO_TERM_COLOR=always
11
12COPY script/linux script/
13RUN ./script/linux
14COPY script/install-mold script/install-cmake script/
15RUN ./script/install-mold "2.34.0"
16RUN ./script/install-cmake "3.30.4"
17
18COPY . .
19
20# When debugging, make these into individual RUN statements.
21# Cleanup to avoid saving big layers we aren't going to use.
22RUN . "$HOME/.cargo/env" \
23    && cargo fetch \
24    && cargo build \
25    && cargo run -- --help \
26    && cargo clean --quiet