Skip to content

Commit d9efce5

Browse files
committed
chore(docker): parameterize all versions as build-args
1 parent 7985845 commit d9efce5

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

scripts/docker/Dockerfile

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
# syntax=docker/dockerfile:1.4
22

33
###### Foundry builder
4-
FROM rust:alpine3.19 as foundry-build-environment
4+
ARG FOUNDRY_BUILDER_ALPINE_VERSION=3.19
5+
ARG FOUNDRY_BUILDER_RUST_VERSION=1.81
6+
ARG NODE_VERSION=20
7+
ARG DEBIAN_VERSION=bookworm
8+
FROM rust:${FOUNDRY_BUILDER_RUST_VERSION}-alpine${FOUNDRY_BUILDER_ALPINE_VERSION} as foundry-build-environment
59

6-
ARG TARGETARCH
710
WORKDIR /opt
8-
ARG FOUNDRY_COMMIT=a17869a6dcce7ce3765c5ed521d40ddb572de9f0
911

10-
RUN apk add clang lld curl build-base linux-headers git \
12+
ARG FOUNDRY_COMMIT=a17869a6dcce7ce3765c5ed521d40ddb572de9f0
13+
RUN apk add --no-cache clang lld curl build-base linux-headers git \
1114
&& mkdir foundry \
1215
&& cd foundry \
1316
&& git init \
1417
&& git remote add origin https://github.com/foundry-rs/foundry.git \
1518
&& git fetch --depth 1 origin "${FOUNDRY_COMMIT}" \
1619
&& git checkout FETCH_HEAD
1720

21+
ARG TARGETARCH
1822
RUN [[ "$TARGETARCH" = "arm64" ]] && echo "export CFLAGS=-mno-outline-atomics" >> $HOME/.profile || touch $HOME/.profile
1923

2024
WORKDIR /opt/foundry
2125

22-
## see <https://github.com/foundry-rs/foundry/issues/7925>
23-
#RUN git update-index --force-write-index
24-
2526
RUN --mount=type=cache,target=/root/.cargo/registry --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/opt/foundry/target \
2627
source $HOME/.profile && cargo build --release --features foundry-cast/aws-kms,forge/aws-kms \
2728
&& mkdir out \
@@ -34,8 +35,8 @@ RUN --mount=type=cache,target=/root/.cargo/registry --mount=type=cache,target=/r
3435
&& strip out/chisel \
3536
&& strip out/anvil;
3637

37-
###### SPlit bas eimage for compatibly parallelizable builds
38-
FROM node:20-bookworm as base
38+
###### Split base image for compatibly parallelizable builds
39+
FROM node:${NODE_VERSION}-${DEBIAN_VERSION} as base
3940

4041
RUN apt-get update \
4142
&& apt-get install -y \
@@ -45,7 +46,8 @@ RUN apt-get update \
4546
&& sed -i '/en_US.UTF-8/s/^# //' /etc/locale.gen \
4647
&& locale-gen
4748

48-
ENV YARN_VERSION 1.22.22
49+
ARG YARN_VERSION=1.22.22
50+
ENV YARN_VERSION ${YARN_VERSION}
4951
# replace base image yarn 1.19
5052
# checksums and sigs for 1.22 not available as of now...
5153
# https://github.com/nodejs/docker-node/blob/07bd7414c9eeb7a134951122e1105e8c849f770e/Dockerfile-debian.template
@@ -87,9 +89,10 @@ RUN (mkdir /home/node/.rbenv \
8789
) \
8890
&& echo 'eval "$(/home/node/.rbenv/bin/rbenv init -)"' >> /home/node/.bashrc
8991

92+
ARG BUNDLER_VERSION=2.5.8
9093
RUN bash -c 'eval "$(/home/node/.rbenv/bin/rbenv init -)" \
9194
&& rbenv install \
92-
&& gem install bundler -v 2.5.8 \
95+
&& gem install bundler -v ${BUNDLER_VERSION} \
9396
&& gem install bigdecimal cocoapods \
9497
&& bundle install'
9598

0 commit comments

Comments
 (0)