Skip to content

Commit 9dc53cf

Browse files
author
Michael de Hoog
authored
Switch to git clone for geth versioning (#101)
Fixes #75
1 parent 13443fd commit 9dc53cf

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

Dockerfile

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,34 @@
1-
# syntax=docker/dockerfile:1-labs
21
FROM golang:1.19 as op
32

43
WORKDIR /app
54

6-
ENV REPO=https://github.com/ethereum-optimism/optimism
5+
ENV REPO=https://github.com/ethereum-optimism/optimism.git
76
ENV VERSION=v1.1.1
8-
ENV CHECKSUM=c0f3dbce8729016103b8390f9ee81089cd858242df6a45a42c59555f1c9e9106
9-
ADD --checksum=sha256:$CHECKSUM $REPO/archive/op-node/$VERSION.tar.gz ./
7+
# for verification:
8+
ENV COMMIT=89ed69d80bbec7f2b1dd69e7e48cb7119839d58a
109

11-
RUN tar -xvf ./$VERSION.tar.gz --strip-components=1 && \
12-
cd op-node && \
10+
RUN git clone $REPO --branch op-node/$VERSION --single-branch . && \
11+
git switch -c branch-$VERSION && \
12+
bash -c '[ "$(git rev-parse HEAD)" = "$COMMIT" ]'
13+
14+
RUN cd op-node && \
1315
make op-node
1416

1517
FROM golang:1.19 as geth
1618

1719
WORKDIR /app
1820

19-
ENV REPO=https://github.com/ethereum-optimism/op-geth
21+
ENV REPO=https://github.com/ethereum-optimism/op-geth.git
2022
ENV VERSION=v1.101200.1-rc.2
21-
ENV CHECKSUM=acdd027c85cf2edaec198f888a543445821182eaef461bc9d1a32527bd186ee3
22-
ADD --checksum=sha256:$CHECKSUM $REPO/archive/$VERSION.tar.gz ./
23+
# for verification:
24+
ENV COMMIT=368310232f16b7697d3a79ea7f946f0b2b21ab3f
25+
26+
# avoid depth=1, so the geth build can read tags
27+
RUN git clone $REPO --branch $VERSION --single-branch . && \
28+
git switch -c branch-$VERSION && \
29+
bash -c '[ "$(git rev-parse HEAD)" = "$COMMIT" ]'
2330

24-
RUN tar -xvf ./$VERSION.tar.gz --strip-components=1 && \
25-
go run build/ci.go install -static ./cmd/geth
31+
RUN go run build/ci.go install -static ./cmd/geth
2632

2733
FROM golang:1.19
2834

0 commit comments

Comments
 (0)