Files
genesis/Dockerfile.rlp-export
zeekayandHanzo Dev 156d8c8a0c fix(rlp-export,rlp-import): make the images buildable at all
ghcr.io/luxfi/rlp-export has never existed. The CronJob that is meant to
be mainnet's only C-Chain backup has referenced :latest since June and
every run died on ImagePullBackOff, because the image could not be built:

  - Dockerfile.rlp-export ran `go build ./cmd/rlp-export` against the ROOT
    module, but cmd/ is a nested module — the package is not in the root
    module at all ("main module does not contain package ...").
  - Falling back to the cmd module does not work either: cmd/go.mod carries
    `replace github.com/luxfi/node => ../../node`, an out-of-tree path that
    cannot exist inside a build context.

Both tools import nothing outside the standard library (checked: their
main.go and main_test.go are stdlib-only). So they get their own modules
and their Dockerfiles build from their own directory. No module download,
no network, no unresolvable replace.

Proven: `GOPROXY=off go build` and `go test` both pass for each tool.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-28 09:41:14 -07:00

24 lines
796 B
Docker

# Dockerfile for the rlp-export image.
#
# Builds from cmd/rlp-export ALONE. That directory is its own stdlib-only Go
# module, so this build needs no module download and no network — and, unlike
# the previous version of this file, it does not try to build a package that
# lives outside the root module.
#
# Build:
# docker build -f Dockerfile.rlp-export -t ghcr.io/luxfi/rlp-export:vX.Y.Z .
FROM golang:1.26-alpine AS builder
WORKDIR /src
COPY cmd/rlp-export/ ./
ARG TARGETOS=linux
ARG TARGETARCH=amd64
ENV CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH}
RUN go build -trimpath -ldflags="-s -w" -o /out/rlp-export .
FROM alpine:3.20
RUN apk add --no-cache ca-certificates tzdata
COPY --from=builder /out/rlp-export /usr/local/bin/rlp-export
ENTRYPOINT ["/usr/local/bin/rlp-export"]