github.com/btcsuite/btcd@v0.24.0/.github/workflows/Dockerfile (about)

     1  # GitHub action dockerfile
     2  # Requires docker experimental features as buildx and BuildKit so not suitable for developers regular use.
     3  # https://docs.docker.com/develop/develop-images/build_enhancements/#to-enable-buildkit-builds
     4  
     5  ###########################
     6  # Build binaries stage
     7  ###########################
     8  FROM --platform=$BUILDPLATFORM golang:1.17.8-alpine3.15 AS build
     9  ADD . /app
    10  WORKDIR /app
    11  # Arguments required to build binaries targetting the correct OS and CPU architectures
    12  ARG TARGETOS TARGETARCH
    13  # Actually building the binaries
    14  RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go install -v . ./cmd/...
    15  
    16  ###########################
    17  # Build docker image stage
    18  ###########################
    19  FROM alpine:3.15
    20  COPY --from=build /go/bin /bin
    21  # 8333  Mainnet Bitcoin peer-to-peer port
    22  # 8334  Mainet RPC port
    23  EXPOSE 8333 8334
    24  ENTRYPOINT ["btcd"]