2021-07-07 03:39:27 +02:00
|
|
|
# This Dockerfile builds lbcd from source and creates a small (55 MB) docker container based on alpine linux.
|
2019-09-05 15:37:43 +02:00
|
|
|
#
|
2021-07-07 03:39:27 +02:00
|
|
|
# Clone this repository and run the following command to build and tag a fresh lbcd amd64 container:
|
2019-09-05 15:37:43 +02:00
|
|
|
#
|
2021-07-07 03:39:27 +02:00
|
|
|
# docker build . -t yourregistry/lbcd
|
2019-09-05 15:37:43 +02:00
|
|
|
#
|
|
|
|
# You can use the following command to buid an arm64v8 container:
|
|
|
|
#
|
2021-07-07 03:39:27 +02:00
|
|
|
# docker build . -t yourregistry/lbcd --build-arg ARCH=arm64v8
|
2019-09-05 15:37:43 +02:00
|
|
|
#
|
|
|
|
# For more information how to use this docker image visit:
|
2021-07-07 03:39:27 +02:00
|
|
|
# https://github.com/lbryio/lbcd/tree/master/docs
|
2019-09-05 15:37:43 +02:00
|
|
|
#
|
2022-04-25 07:36:13 +02:00
|
|
|
# 9246 Mainnet LBRY peer-to-peer port
|
2018-08-15 02:59:48 +02:00
|
|
|
# 9245 Mainet RPC port
|
2019-09-05 15:37:43 +02:00
|
|
|
|
|
|
|
ARG ARCH=amd64
|
2022-04-25 07:36:13 +02:00
|
|
|
|
|
|
|
FROM golang:1.18.1 AS build-container
|
2019-09-05 15:37:43 +02:00
|
|
|
|
|
|
|
ARG ARCH
|
|
|
|
|
|
|
|
ADD . /app
|
|
|
|
WORKDIR /app
|
|
|
|
RUN set -ex \
|
|
|
|
&& if [ "${ARCH}" = "amd64" ]; then export GOARCH=amd64; fi \
|
2021-01-14 20:39:43 +01:00
|
|
|
&& if [ "${ARCH}" = "arm32v7" ]; then export GOARCH=arm; fi \
|
2019-09-05 15:37:43 +02:00
|
|
|
&& if [ "${ARCH}" = "arm64v8" ]; then export GOARCH=arm64; fi \
|
|
|
|
&& echo "Compiling for $GOARCH" \
|
|
|
|
&& go install -v . ./cmd/...
|
|
|
|
|
2022-04-25 07:36:13 +02:00
|
|
|
FROM $ARCH/debian:bullseye-20220418-slim
|
2019-09-05 15:37:43 +02:00
|
|
|
|
|
|
|
COPY --from=build-container /go/bin /bin
|
|
|
|
|
2021-07-07 03:39:27 +02:00
|
|
|
VOLUME ["/root/.lbcd"]
|
2019-09-05 15:37:43 +02:00
|
|
|
|
2021-07-07 03:39:27 +02:00
|
|
|
EXPOSE 9245 9246
|
2019-09-05 15:37:43 +02:00
|
|
|
|
2021-07-07 03:39:27 +02:00
|
|
|
ENTRYPOINT ["lbcd"]
|