2022-06-02 08:49:21 +00:00
|
|
|
# syntax = docker/dockerfile:1.2
|
2022-09-19 07:38:08 +00:00
|
|
|
FROM docker.io/library/golang:1.19-alpine3.16 AS builder
|
2020-10-02 08:16:21 +00:00
|
|
|
|
2022-05-12 08:17:24 +00:00
|
|
|
RUN apk --no-cache add build-base linux-headers git bash ca-certificates libstdc++
|
2016-11-15 17:57:56 +00:00
|
|
|
|
2020-08-21 12:38:11 +00:00
|
|
|
WORKDIR /app
|
2021-07-09 09:40:11 +00:00
|
|
|
ADD . .
|
2021-07-09 08:37:36 +00:00
|
|
|
|
2022-06-02 08:49:21 +00:00
|
|
|
RUN --mount=type=cache,target=/root/.cache \
|
|
|
|
--mount=type=cache,target=/tmp/go-build \
|
|
|
|
--mount=type=cache,target=/go/pkg/mod \
|
|
|
|
make all db-tools
|
2017-09-05 09:16:59 +00:00
|
|
|
|
2022-09-19 07:38:08 +00:00
|
|
|
FROM docker.io/library/alpine:3.16
|
2016-11-15 17:57:56 +00:00
|
|
|
|
2022-08-14 02:04:15 +00:00
|
|
|
RUN apk add --no-cache ca-certificates curl libstdc++ jq tzdata
|
2022-06-30 10:11:37 +00:00
|
|
|
# copy compiled artifacts from builder
|
2020-08-01 07:39:04 +00:00
|
|
|
COPY --from=builder /app/build/bin/* /usr/local/bin/
|
2016-11-15 17:57:56 +00:00
|
|
|
|
2022-06-30 10:11:37 +00:00
|
|
|
# Setup user and group
|
|
|
|
#
|
|
|
|
# from the perspective of the container, uid=1000, gid=1000 is a sensible choice
|
|
|
|
# (mimicking Ubuntu Server), but if caller creates a .env (example in repo root),
|
|
|
|
# these defaults will get overridden when make calls docker-compose
|
|
|
|
ARG UID=1000
|
|
|
|
ARG GID=1000
|
|
|
|
RUN adduser -D -u $UID -g $GID erigon
|
2021-07-19 13:40:09 +00:00
|
|
|
USER erigon
|
2022-06-30 10:11:37 +00:00
|
|
|
RUN mkdir -p ~/.local/share/erigon
|
|
|
|
|
|
|
|
EXPOSE 8545 \
|
|
|
|
8551 \
|
|
|
|
8546 \
|
|
|
|
30303 \
|
|
|
|
30303/udp \
|
|
|
|
42069 \
|
|
|
|
42069/udp \
|
|
|
|
8080 \
|
|
|
|
9090 \
|
|
|
|
6060
|
2021-07-27 02:39:21 +00:00
|
|
|
|
2021-07-27 02:41:17 +00:00
|
|
|
# https://github.com/opencontainers/image-spec/blob/main/annotations.md
|
2021-07-27 02:39:21 +00:00
|
|
|
ARG BUILD_DATE
|
|
|
|
ARG VCS_REF
|
2022-05-21 09:21:35 +00:00
|
|
|
ARG VERSION
|
2021-07-27 02:39:21 +00:00
|
|
|
LABEL org.label-schema.build-date=$BUILD_DATE \
|
|
|
|
org.label-schema.description="Erigon Ethereum Client" \
|
2022-06-30 10:11:37 +00:00
|
|
|
org.label-schema.name="Erigon" \
|
|
|
|
org.label-schema.schema-version="1.0" \
|
2021-07-27 02:39:21 +00:00
|
|
|
org.label-schema.url="https://torquem.ch" \
|
|
|
|
org.label-schema.vcs-ref=$VCS_REF \
|
|
|
|
org.label-schema.vcs-url="https://github.com/ledgerwatch/erigon.git" \
|
|
|
|
org.label-schema.vendor="Torquem" \
|
2022-06-30 10:11:37 +00:00
|
|
|
org.label-schema.version=$VERSION
|