File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -14,14 +14,19 @@ FROM ubuntu:22.04 AS build
14
14
# Install packaged dependencies
15
15
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
16
16
build-essential git curl cmake gcc g++ pkg-config libmagic-dev \
17
- libssl-dev zlib1g-dev ca-certificates
17
+ libssl-dev zlib1g-dev ca-certificates mold clang
18
18
19
19
# Install the stable toolchain with rustup
20
20
RUN curl https://sh.rustup.rs >/tmp/rustup-init && \
21
21
chmod +x /tmp/rustup-init && \
22
22
/tmp/rustup-init -y --no-modify-path --default-toolchain stable --profile minimal
23
23
ENV PATH=/root/.cargo/bin:$PATH
24
24
25
+ # Configure linking to use mold instead for speed (need to use clang because gcc
26
+ # is too old on this image)
27
+ ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=clang
28
+ ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS=-Clink-arg=-fuse-ld=mold
29
+
25
30
# Build the dependencies in a separate step to avoid rebuilding all of them
26
31
# every time the source code changes. This takes advantage of Docker's layer
27
32
# caching, and it works by copying the Cargo.{toml,lock} with dummy source code
You can’t perform that action at this time.
0 commit comments