github.com/lbryio/lbcd@v0.22.119/contrib/linode/Dockerfile.deploy (about)

     1  # This Dockerfile builds btcd from source and creates a small (55 MB) docker container based on alpine linux.
     2  #
     3  # Clone this repository and run the following command to build and tag a fresh btcd amd64 container:
     4  #
     5  # docker build . -t yourregistry/btcd
     6  #
     7  # You can use the following command to buid an arm64v8 container:
     8  #
     9  # docker build . -t yourregistry/btcd --build-arg ARCH=arm64v8
    10  #
    11  # For more information how to use this docker image visit:
    12  # https://github.com/lbryio/lbcd/tree/master/docs
    13  #
    14  # 9246  Mainnet Bitcoin peer-to-peer port
    15  # 9245  Mainet RPC port
    16  
    17  FROM golang AS build-container
    18  
    19  # ENV GO111MODULE=on
    20  
    21  ADD . /app
    22  WORKDIR /app
    23  RUN set -ex \
    24    && if [ "${ARCH}" = "amd64" ]; then export GOARCH=amd64; fi \
    25    && if [ "${ARCH}" = "arm64v8" ]; then export GOARCH=arm64; fi \
    26    && echo "Compiling for $GOARCH" \
    27    && CGO_ENABLED=0 go build .
    28  
    29  FROM debian:11-slim
    30  
    31  COPY --from=build-container /app/lbcd /
    32  COPY --from=build-container /app/contrib/linode/run.sh /
    33  
    34  VOLUME ["/root/.lbcd"]
    35  
    36  EXPOSE 9245 9246
    37  
    38  ENTRYPOINT ["/run.sh"]