diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e2ac84f1..cf74fe25 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,9 @@ jobs: - name: Docker Build run: DOCKER_BUILDKIT=1 docker build . -f dockerfiles/build_linux --output build + + - name: Docker Build Arm64 + run: DOCKER_BUILDKIT=1 docker buildx build --platform linux/arm64 . -f dockerfiles/build_linux_arm64 --output ./build/arm64 - name: Docker Build Windows run: DOCKER_BUILDKIT=1 docker build . -f dockerfiles/build_windows --output ./build/windows @@ -42,4 +45,6 @@ jobs: ./build/windows/wart-wallet-windows.exe ./build/windows/wart-node-windows.exe ./build/wart-node-linux - ./build/wart-wallet-linux \ No newline at end of file + ./build/wart-wallet-linux + ./build/arm64/wart-node-linux-arm64 + ./build/arm64/wart-wallet-linux-arm64 \ No newline at end of file diff --git a/README.md b/README.md index aa5c639c..6ed7965a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Docker Release](https://github.com/warthog-network/Warthog/actions/workflows/release.yml/badge.svg)](https://github.com/JulsKawa/Warthog/actions/workflows/release.yml) +[![Docker Release](https://github.com/warthog-network/Warthog/actions/workflows/release.yml/badge.svg)](https://github.com/warthog-network/Warthog/actions/workflows/release.yml) WARTHOG REFERENCE IMPLEMENTATION Copyright (c) 2023 - 2024 Pumbaa, Timon & Rafiki @@ -103,6 +103,12 @@ To compile from source see below or [here](https://warthog.network/docs/) for a #### Build for Linux * Run `DOCKER_BUILDKIT=1 docker build . -f dockerfiles/build_linux --output build` in the repo directory. +#### Build for Linux (ARM64) +* Run `export DOCKER_CLI_EXPERIMENTAL=enabled` +* Run `docker run --rm --privileged docker/binfmt` +* Run `docker buildx create --use --name multi-arch-builder` +* Run `DOCKER_BUILDKIT=1 docker buildx build --platform linux/arm64 . -f dockerfiles/build_linux_arm64 --output ./build/arm64` in the repo. +* ARM64 binaries are located in `./build/arm64` directory. #### Build for Windows (cross-compilation on Linux) * Run `DOCKER_BUILDKIT=1 docker build . -f dockerfiles/build_windows --output ./build/windows` in the repo. * Windows binaries are located in `./build/windows` directory. diff --git a/dockerfiles/build_linux_arm64 b/dockerfiles/build_linux_arm64 new file mode 100644 index 00000000..4b995afb --- /dev/null +++ b/dockerfiles/build_linux_arm64 @@ -0,0 +1,19 @@ +FROM alpine:3.17.2 AS build +RUN apk add meson libgcc musl-dev gcc g++ upx +COPY . /code +RUN mkdir /build +WORKDIR /code +RUN --mount=type=cache,target=/build LDFLAGS='-static' meson /build/code --default-library static --buildtype=release +WORKDIR /build/code +RUN --mount=type=cache,target=/build ninja +RUN mkdir /install +RUN --mount=type=cache,target=/build DESTDIR=/install meson install +RUN upx /install/usr/local/bin/wart-node + +FROM scratch AS export-stage +COPY --from=build install/usr/local/bin/wart-node ./wart-node-linux-arm64 +COPY --from=build install/usr/local/bin/wart-wallet ./wart-wallet-linux-arm64 + +VOLUME ["/warthog/.warthog"] +ENTRYPOINT ["./wart-node-linux-arm64", "--chain-db=/warthog/.warthog/chain.db", "--peers-db=/warthog/.warthog/peers.db"] +EXPOSE 9186 3000