Skip to content

Commit

Permalink
remove build_env.sh from Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ceyonur committed Jan 29, 2025
1 parent 8034752 commit 74edc97
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ ARG BUILDPLATFORM
# build_env.sh is used to capture the environmental changes required by the build step since RUN
# environment state is not otherwise persistent.
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ] && [ "$BUILDPLATFORM" != "linux/arm64" ]; then \
apt-get update && apt-get install -y gcc-aarch64-linux-gnu && \
echo "export CC=aarch64-linux-gnu-gcc" > ./build_env.sh \
apt-get update && apt-get install -y gcc-aarch64-linux-gnu \
; elif [ "$TARGETPLATFORM" = "linux/amd64" ] && [ "$BUILDPLATFORM" != "linux/amd64" ]; then \
apt-get update && apt-get install -y gcc-x86-64-linux-gnu && \
echo "export CC=x86_64-linux-gnu-gcc" > ./build_env.sh \
; else \
echo "export CC=gcc" > ./build_env.sh \
apt-get update && apt-get install -y gcc-x86-64-linux-gnu \
; fi

# Copy avalanche dependencies first (intermediate docker image caching)
Expand All @@ -44,10 +40,7 @@ RUN [ -d ./build ] && rm -rf ./build/* || true
ARG SUBNET_EVM_COMMIT
ARG CURRENT_BRANCH

RUN . ./build_env.sh && \
echo "{CC=$CC, TARGETPLATFORM=$TARGETPLATFORM, BUILDPLATFORM=$BUILDPLATFORM}" && \
export GOARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) && \
export SUBNET_EVM_COMMIT=$SUBNET_EVM_COMMIT && export CURRENT_BRANCH=$CURRENT_BRANCH && ./scripts/build.sh build/subnet-evm
RUN export SUBNET_EVM_COMMIT=$SUBNET_EVM_COMMIT && export CURRENT_BRANCH=$CURRENT_BRANCH && ./scripts/build.sh build/subnet-evm

# ============= Cleanup Stage ================
FROM $AVALANCHEGO_NODE_IMAGE AS builtImage
Expand Down

0 comments on commit 74edc97

Please sign in to comment.