File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 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
1414#  Install packaged dependencies
1515RUN  apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
1616    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 
1818
1919#  Install the stable toolchain with rustup
2020RUN  curl https://sh.rustup.rs >/tmp/rustup-init && \
2121    chmod +x /tmp/rustup-init && \
2222    /tmp/rustup-init -y --no-modify-path --default-toolchain stable --profile minimal
2323ENV  PATH=/root/.cargo/bin:$PATH
2424
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+ 
2530#  Build the dependencies in a separate step to avoid rebuilding all of them
2631#  every time the source code changes. This takes advantage of Docker's layer
2732#  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