github.com/decred/dcrlnd@v0.7.6/docker/dcrd/Dockerfile (about) 1 FROM golang:1.20-alpine as builder 2 3 # Install build dependencies. 4 RUN apk add --no-cache git 5 6 WORKDIR $GOPATH/src/github.com/decred 7 8 ARG DCRD_VERSION=release-v1.7.7 9 ARG DCRCTL_VERSION=release-v1.7.7 10 11 # Grab and install the latest version of dcrd and all related dependencies. 12 RUN git clone -b $DCRD_VERSION https://github.com/decred/dcrd.git \ 13 && cd dcrd/ \ 14 && go install . ./... 15 16 # Grab and install the latest version of dcrctl and all related dependencies. 17 RUN git clone -b $DCRCTL_VERSION https://github.com/decred/dcrctl.git \ 18 && cd dcrctl/ \ 19 && go install 20 21 # Start a new image 22 FROM alpine as final 23 24 RUN apk add --no-cache \ 25 bash \ 26 ca-certificates 27 28 # Copy the compiled binaries from the builder image. 29 COPY --from=builder /go/bin/* /bin/ 30 31 COPY "start-dcrd.sh" . 32 33 # Generate an certificate for both dcrd and dcrwallet. 34 RUN mkdir "/config" \ 35 && chmod +x start-dcrd.sh \ 36 && "/bin/gencerts" -H="dcrd" -H="dcrwallet" -f -L /config/rpc.cert /config/rpc.key 37 38 # Create a volume to house pregenerated RPC credentials. This will be 39 # shared with any containers so they can securely query dcrd's RPC server. 40 # You should NOT do this before certificate generation! 41 # Otherwise manually generated certificate will be overridden with shared 42 # mounted volume! For more info read dockerfile "VOLUME" documentation. 43 VOLUME ["/config"] 44 45 # Expose mainnet ports (server, rpc) 46 EXPOSE 9108 9109 47 48 # Expose testnet ports (server, rpc) 49 EXPOSE 19108 19109 50 51 # Expose simnet ports (server, rpc) 52 EXPOSE 18555 19556