From 7daf79ef8f2dbdbcc11e849f17f1334e503d81b1 Mon Sep 17 00:00:00 2001
From: Jeffrey Picard <jeff@jeffreypicard.com>
Date: Thu, 11 Nov 2021 08:47:53 +0000
Subject: [PATCH] figure out why these changes were needed

---
 Dockerfile | 16 +++++++---------
 run.sh     |  2 +-
 2 files changed, 8 insertions(+), 10 deletions(-)

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=