Add Makefile target to build static linux binaries. #94

Merged
arijitAD merged 2 commits from linux-static-binary into v1.10.4-statediff 2021-07-07 04:54:06 +00:00
arijitAD commented 2021-07-05 06:29:00 +00:00 (Migrated from github.com)

Tested it by building in CentOS docker image.

# Build Geth in a stock Go builder container
FROM centos:latest as builder

RUN yum -y install make gcc kernel-headers git golang

ADD . /go-ethereum

# Pull Geth into a second stage deploy alpine container
FROM alpine:latest

RUN apk add --no-cache ca-certificates
COPY --from=builder /go-ethereum/build/bin/geth-linux-amd64 /usr/local/bin/geth

EXPOSE 8545 8546 30303 30303/udp
ENTRYPOINT ["geth"]

Static Linked Binary:
Screenshot 2021-07-05 at 11 07 18 AM

Dynamic Linked Binary:
Screenshot 2021-07-05 at 11 11 30 AM

Tested it by building in CentOS docker image. ```dockerfile= # Build Geth in a stock Go builder container FROM centos:latest as builder RUN yum -y install make gcc kernel-headers git golang ADD . /go-ethereum # Pull Geth into a second stage deploy alpine container FROM alpine:latest RUN apk add --no-cache ca-certificates COPY --from=builder /go-ethereum/build/bin/geth-linux-amd64 /usr/local/bin/geth EXPOSE 8545 8546 30303 30303/udp ENTRYPOINT ["geth"] ``` Static Linked Binary: <img width="1337" alt="Screenshot 2021-07-05 at 11 07 18 AM" src="https://user-images.githubusercontent.com/5843604/124426877-481bbc00-dd88-11eb-81f0-f4b10fb9fbc5.png"> Dynamic Linked Binary: <img width="722" alt="Screenshot 2021-07-05 at 11 11 30 AM" src="https://user-images.githubusercontent.com/5843604/124426887-4b16ac80-dd88-11eb-8b06-07cd635a49c6.png">
ashwinphatak (Migrated from github.com) reviewed 2021-07-05 08:27:16 +00:00
arijitAD (Migrated from github.com) reviewed 2021-07-05 13:04:25 +00:00
arijitAD (Migrated from github.com) reviewed 2021-07-05 13:10:41 +00:00
ashwinphatak (Migrated from github.com) reviewed 2021-07-06 03:58:07 +00:00
arijitAD (Migrated from github.com) reviewed 2021-07-06 11:18:44 +00:00
ashwinphatak (Migrated from github.com) reviewed 2021-07-06 11:28:17 +00:00
ashwinphatak (Migrated from github.com) approved these changes 2021-07-06 11:30:27 +00:00
i-norden approved these changes 2021-07-06 16:39:46 +00:00
i-norden left a comment
Member

LGTM except this shouldn't be merged into this branch as it needs to stay even with the release of the same name. Should merge into v1.10.4-statediff and then cut this into a new release off a new release-feature branch (v1.10.4-statediff-0.0.25).

Probably should include #95 in that same release so merge both into v1.10.4-statediff, then push that state to the new feature-release branch v1.10.4-statediff-0.0.25 and cut a release against that.

LGTM except this shouldn't be merged into this branch as it needs to stay even with the release of the same name. Should merge into v1.10.4-statediff and then cut this into a new release off a new release-feature branch (v1.10.4-statediff-0.0.25). Probably should include #95 in that same release so merge both into v1.10.4-statediff, then push that state to the new feature-release branch v1.10.4-statediff-0.0.25 and cut a release against that.
arijitAD (Migrated from github.com) reviewed 2021-07-06 17:56:12 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/go-ethereum#94
No description provided.