Skip to content
This repository was archived by the owner on Sep 30, 2026. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# build for amd64
FROM golang:1.13.5 AS build
FROM golang:alpine as build

ENV ROOT "/tmp/eth2stats-client"
RUN apk add --no-cache ca-certificates build-base

WORKDIR $ROOT
WORKDIR /build

ADD go.mod go.mod
ADD go.sum go.sum
Expand All @@ -12,13 +11,13 @@ ADD . .

RUN make build

# create application container for amd64
FROM ubuntu
FROM scratch

RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=build /etc/ssl/certs/ca-certificates.crt \
/etc/ssl/certs/ca-certificates.crt

WORKDIR /
COPY --from=build /build/eth2stats-client /eth2stats-client

COPY --from=build /tmp/eth2stats-client/eth2stats-client .
WORKDIR /

ENTRYPOINT ["/eth2stats-client"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION := "$(shell git describe --abbrev=0 --tags 2> /dev/null || echo 'v0.0.0')+$(shell git rev-parse --short HEAD)"

build:
go build -ldflags "-X main.buildVersion=$(VERSION)"
go build -ldflags "-X main.buildVersion=$(VERSION) -extldflags "-static"" -o eth2stats-client

run:
go run main.go
Expand Down