diff --git a/geth/build-race.sh b/geth/build-race.sh index 8297466..9598fdb 100755 --- a/geth/build-race.sh +++ b/geth/build-race.sh @@ -3,6 +3,25 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) cd ${SCRIPT_DIR}/../source +# need to update dockerfile to use debian instead of alpine +ORIGINAL_DOCKER_FILE="Dockerfile" +NEW_DOCKER_FILE="Dockerfile.race" + +sed -e 's|-alpine AS builder| AS builder|' \ + -e 's|RUN apk add --no-cache gcc musl-dev linux-headers git|RUN apt-get update \&\& apt-get install -y --no-install-recommends build-essential git \&\& rm -rf /var/lib/apt/lists/*|' \ + -e 's|RUN cd /go-ethereum \&\& go run build/ci.go install -static ./cmd/geth|RUN cd /go-ethereum \&\& go run build/ci.go install ./cmd/geth|' \ + -e 's|FROM alpine:latest|FROM debian:bookworm-slim|' \ + -e 's|RUN apk add --no-cache ca-certificates|RUN apt-get update \&\& apt-get install -y --no-install-recommends ca-certificates \&\& rm -rf /var/lib/apt/lists/*|' \ + "$ORIGINAL_DOCKER_FILE" > "$NEW_DOCKER_FILE" + +if((`stat -c%s "${ORIGINAL_DOCKER_FILE}"`==`stat -c%s "${NEW_DOCKER_FILE}"`));then + echo "no changes detected, aborting..." + echo "needed to update dockerfile" + exit 1 +fi + +mv $NEW_DOCKER_FILE $ORIGINAL_DOCKER_FILE + # need to add -race flag to geth custom build script ORIGINAL_CI_FILE="build/ci.go" NEW_CI_FILE="build/ci.race.go"