mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 07:36:44 +00:00
Merge pull request #227 from maticnetwork/victor/pos-48-refactor-bor-dockerfile
Apply best practices to Dockerfile
This commit is contained in:
commit
5d0f0b70bd
3 changed files with 24 additions and 10 deletions
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
|
@ -6,9 +6,9 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v2.1.3
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16.7
|
||||
go-version: 1.17
|
||||
- name: "Build binaries"
|
||||
run: make all
|
||||
- name: "Run tests"
|
||||
|
|
|
|||
23
Dockerfile
23
Dockerfile
|
|
@ -1,18 +1,29 @@
|
|||
# Build Geth in a stock Go builder container
|
||||
FROM golang:1.17-alpine as builder
|
||||
|
||||
RUN apk add --no-cache make gcc musl-dev linux-headers git bash
|
||||
RUN set -x \
|
||||
&& buildDeps='bash build-base musl-dev linux-headers git' \
|
||||
&& apk add --update $buildDeps \
|
||||
&& rm -rf /var/cache/apk/* \
|
||||
&& mkdir -p /bor
|
||||
|
||||
ADD . /bor
|
||||
RUN cd /bor && make bor-all
|
||||
WORKDIR /bor
|
||||
COPY . .
|
||||
RUN make bor-all
|
||||
|
||||
CMD ["/bin/bash"]
|
||||
|
||||
# Pull Bor into a second stage deploy alpine container
|
||||
FROM alpine:latest
|
||||
FROM alpine:3.14
|
||||
|
||||
RUN set -x \
|
||||
&& apk add --update --no-cache \
|
||||
ca-certificates \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
RUN apk add --no-cache ca-certificates
|
||||
COPY --from=builder /bor/build/bin/bor /usr/local/bin/
|
||||
COPY --from=builder /bor/build/bin/bootnode /usr/local/bin/
|
||||
|
||||
EXPOSE 8545 8546 8547 30303 30303/udp
|
||||
EXPOSE 8545 8546 8547 30303 30303/udp
|
||||
|
||||
ENTRYPOINT ["bor"]
|
||||
|
|
|
|||
|
|
@ -9,7 +9,10 @@ RUN cd /bor && make bor-all
|
|||
# Pull all binaries into a second stage deploy alpine container
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk add --no-cache ca-certificates
|
||||
RUN set -x \
|
||||
&& apk add --update --no-cache \
|
||||
ca-certificates \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
COPY --from=builder /bor/build/bin/* /usr/local/bin/
|
||||
|
||||
EXPOSE 8545 8546 30303 30303/udp
|
||||
EXPOSE 8545 8546 30303 30303/udp
|
||||
|
|
|
|||
Loading…
Reference in a new issue