forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix github workflow build docker, remove govuln
- Loading branch information
1 parent
59ad1bf
commit 61a2aba
Showing
2 changed files
with
24 additions
and
37 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,31 @@ | ||
FROM golang:latest | ||
FROM golang:1.20-alpine as builder | ||
|
||
ARG BOR_DIR=/var/lib/bor | ||
ENV BOR_DIR=$BOR_DIR | ||
RUN apk add --no-cache make cmake gcc musl-dev linux-headers git bash build-base libc-dev | ||
# Get dependencies - will also be cached if we won't change go.mod/go.sum | ||
COPY go.mod /go-ethereum/ | ||
COPY go.sum /go-ethereum/ | ||
RUN cd /go-ethereum && go mod download | ||
|
||
RUN apt-get update -y && apt-get upgrade -y \ | ||
&& apt install build-essential git -y \ | ||
&& mkdir -p ${BOR_DIR} | ||
ADD . /go-ethereum | ||
|
||
WORKDIR ${BOR_DIR} | ||
COPY . . | ||
RUN make bor | ||
# For blst | ||
ENV CGO_CFLAGS="-O -D__BLST_PORTABLE__" | ||
ENV CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__" | ||
RUN cd /go-ethereum && go run build/ci.go install -static ./cmd/geth | ||
|
||
RUN cp build/bin/bor /usr/local/bin/geth | ||
# Pull Geth into a second stage deploy alpine container | ||
FROM alpine:3.17 | ||
|
||
ENV PACKAGES ca-certificates jq \ | ||
bash bind-tools tini \ | ||
grep curl sed gcc | ||
|
||
RUN apk add --no-cache $PACKAGES \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
RUN echo "[ ! -z \"\$TERM\" -a -r /etc/motd ] && cat /etc/motd" >> /etc/bash/bashrc | ||
|
||
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/ | ||
|
||
ENV SHELL /bin/bash | ||
EXPOSE 8545 8546 8547 30303 30303/udp | ||
|
||
ENTRYPOINT ["geth"] |