diff --git a/Dockerfile b/Dockerfile index 1a4f3b0e..c0697e8e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,12 +14,9 @@ # 9246 Mainnet Bitcoin peer-to-peer port # 9245 Mainet RPC port -ARG ARCH=amd64 +FROM golang AS build-container -FROM golang:1.17-buster AS build-container - -ARG ARCH -ENV GO111MODULE=on +# ENV GO111MODULE=on ADD . /app WORKDIR /app @@ -27,14 +24,15 @@ RUN set -ex \ && if [ "${ARCH}" = "amd64" ]; then export GOARCH=amd64; fi \ && if [ "${ARCH}" = "arm64v8" ]; then export GOARCH=arm64; fi \ && echo "Compiling for $GOARCH" \ - && go install -v . ./cmd/... + && CGO_ENABLED=0 go build . -FROM $ARCH/alpine:3.14 +FROM debian:11-slim -COPY --from=build-container /go/bin /bin +COPY --from=build-container /app/lbcd / +COPY --from=build-container /app/run.sh / VOLUME ["/root/.lbcd"] EXPOSE 9245 9246 -ENTRYPOINT ["/app/run.sh"] +ENTRYPOINT ["/run.sh"] diff --git a/run.sh b/run.sh index 5261eb08..2966339c 100755 --- a/run.sh +++ b/run.sh @@ -1,2 +1,2 @@ #!/bin/bash -lbcd --txindex --notls --rpcuser=lbry --rpcpass=lbry --rpclisten=$LISTEN_ADDR:9245 +/lbcd --txindex --notls --rpcuser=lbry --rpcpass=lbry --rpclisten=