Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

fix: build proper Docker image for arm64 #501

Merged
merged 6 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/build-docker.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Linux-amd64 Docker build & push
name: Multiplatform Docker build & push
on:
push:
release:
Expand Down Expand Up @@ -28,7 +28,8 @@ jobs:
with:
image: ${{ env.IMAGENAME }}
registry: ${{ env.REGISTRY }}
platform: linux/amd64
multiPlatform: true
platform: linux/amd64,linux/arm64
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
addLatest: ${{ startsWith(github.ref, 'refs/tags/v') }}
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/multiplatform.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ RUN GOARCH=$(echo "$TARGETPLATFORM" | cut -d'/' -f2) go build \
-ldflags="-X 'github.com/getAlby/nostr-wallet-connect/version.Tag=$TAG'" \
-o main cmd/http/main.go

RUN cp `find /go/pkg/mod/github.com/breez/ |grep linux-amd64 |grep libbreez_sdk_bindings.so` ./
RUN cp `find /go/pkg/mod/github.com/get\!alby/ | grep x86_64-unknown-linux-gnu | grep libglalby_bindings.so` ./
RUN cp `find /go/pkg/mod/github.com/get\!alby/ | grep x86_64-unknown-linux-gnu | grep libldk_node.so` ./
COPY ./build/docker/copy_dylibs.sh .
RUN chmod +x copy_dylibs.sh
RUN ./copy_dylibs.sh $(echo "$TARGETPLATFORM" | cut -d'/' -f2)

# Start a new, final image to reduce size.
FROM debian as final
Expand Down
16 changes: 16 additions & 0 deletions build/docker/copy_dylibs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

ARCH="$1"

if [[ "$ARCH" == "amd64" ]]; then
cp "$(go list -m -f "{{.Dir}}" github.com/breez/breez-sdk-go)"/breez_sdk/lib/linux-amd64/libbreez_sdk_bindings.so ./
cp "$(go list -m -f "{{.Dir}}" github.com/getAlby/glalby-go)"/glalby/x86_64-unknown-linux-gnu/libglalby_bindings.so ./
cp "$(go list -m -f "{{.Dir}}" github.com/getAlby/ldk-node-go)"/ldk_node/x86_64-unknown-linux-gnu/libldk_node.so ./
elif [[ "$ARCH" == "arm64" ]]; then
cp "$(go list -m -f "{{.Dir}}" github.com/breez/breez-sdk-go)"/breez_sdk/lib/linux-aarch64/libbreez_sdk_bindings.so ./
cp "$(go list -m -f "{{.Dir}}" github.com/getAlby/glalby-go)"/glalby/aarch64-unknown-linux-gnu/libglalby_bindings.so ./
cp "$(go list -m -f "{{.Dir}}" github.com/getAlby/ldk-node-go)"/ldk_node/aarch64-unknown-linux-gnu/libldk_node.so ./
else
echo "Invalid ARCH value"
exit 1
fi
Loading