Skip to content

Commit

Permalink
trying static
Browse files Browse the repository at this point in the history
  • Loading branch information
frnandu committed Feb 1, 2024
1 parent 1325553 commit 0fc6557
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ RUN apt-get update && \

ENV CGO_ENABLED=1
ENV GOOS=linux
ENV CGO_LDFLAGS=-static
#ENV GOARCH=$GOARCH

#RUN echo "AAA $GOARCH"
Expand All @@ -25,6 +26,7 @@ WORKDIR /build
# Copy and download dependency using go mod
COPY go.mod .
COPY go.sum .
COPY breez-sdk-go .
RUN GOARCH=$(echo "$TARGETPLATFORM" | cut -d'/' -f2) go mod download

# Copy the code into the container
Expand All @@ -35,17 +37,17 @@ COPY --from=frontend /build/frontend/dist ./frontend/dist

RUN GOARCH=$(echo "$TARGETPLATFORM" | cut -d'/' -f2) go build -o main .

RUN wget https://github.com/breez/breez-sdk-go/raw/main/breez_sdk/lib/linux-amd64/libbreez_sdk_bindings.so
#RUN wget https://github.com/breez/breez-sdk-go/raw/main/breez_sdk/lib/linux-amd64/libbreez_sdk_bindings.so

# Start a new, final image to reduce size.
FROM debian as final


ENV LD_LIBRARY_PATH=/usr/lib/libbreez
#ENV LD_LIBRARY_PATH=/usr/lib/libbreez
#
# # Copy the binaries and entrypoint from the builder image.
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /build/libbreez_sdk_bindings.so /usr/lib/libbreez/
#COPY --from=builder /build/libbreez_sdk_bindings.so /usr/lib/libbreez/
COPY --from=builder /build/main /bin/

ENTRYPOINT [ "/bin/main" ]
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ go 1.21

toolchain go1.21.1

replace github.com/breez/breez-sdk-go => ./breez-sdk-go

require (
github.com/breez/breez-sdk-go v0.2.14
github.com/davrux/echo-logrus/v4 v4.0.3
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ github.com/bep/debounce v1.2.1 h1:v67fRdBA9UQu2NhLFXrSg0Brw7CexQekrBwDMM8bzeY=
github.com/bep/debounce v1.2.1/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
github.com/breez/breez-sdk-go v0.2.10 h1:D9mEtVTNWhwoV7L6esxpyjoFyFkFoJ2w2l7iZdfE7NA=
github.com/breez/breez-sdk-go v0.2.10/go.mod h1:EalYMEeQVwRzr6UXnF4QpLlpuWNwQQN9xwtDKNIutBo=
github.com/breez/breez-sdk-go v0.2.14 h1:d9AAbSWXQpE/nMZyVBvmg808zSe5jRl9PkyRLiMD298=
github.com/breez/breez-sdk-go v0.2.14/go.mod h1:EalYMEeQVwRzr6UXnF4QpLlpuWNwQQN9xwtDKNIutBo=
github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M=
Expand Down

0 comments on commit 0fc6557

Please sign in to comment.