Hello! I’m trying to build WhaleWall as a Docker image for an ARM64 environment (Raspberry Pi 4B) but am encountering issues with the build process. Here’s a detailed overview of the steps I've taken and the issues I'm facing:
Steps to Reproduce:
I started with a Dockerfile to build WhaleWall from source for ARM64. I used Go environment variables GOOS=linux, GOARCH=arm64, and CGO_ENABLED=0 to target ARM64 explicitly.
I downloaded the source code for version v0.2.3 from the release page.
I then attempted to build the binary using go build -o whalewall ..
Dockerfile:
Here’s the Dockerfile I’ve been using:
# Use a Go base image with the appropriate Go version for building
FROM golang:1.23 AS builder
# Set environment variables to target ARM64 explicitly
ENV GOOS=linux
ENV GOARCH=arm64
ENV CGO_ENABLED=0
# Install wget to download the release source code
RUN apt-get update && apt-get install -y wget
# Set the working directory
WORKDIR /src
# Download the source code for v0.2.3 and extract it
RUN wget https://github.com/capnspacehook/whalewall/archive/refs/tags/v0.2.3.tar.gz \
&& tar -xzf v0.2.3.tar.gz --strip-components=1 \
&& rm v0.2.3.tar.gz
# Print Go environment to confirm GOOS and GOARCH
RUN go env
# Attempt to build WhaleWall and capture any errors
RUN go build -o whalewall . || { echo "Build failed"; exit 1; }
# List the contents of the directory to verify the binary exists
RUN ls -lh whalewall || echo "Binary not found after build"
# Verify the binary architecture to ensure it's ARM64, if it exists
RUN [ -f whalewall ] && file whalewall || echo "Binary verification skipped because it was not found"
# Create a minimal runtime image for the final stage
FROM debian:bullseye-slim
# Copy the compiled binary from the builder stage
COPY --from=builder /src/whalewall /usr/local/bin/whalewall
# Set permissions for the binary
RUN chmod +x /usr/local/bin/whalewall
# Default command
ENTRYPOINT ["/usr/local/bin/whalewall"]
Observed Behavior:
The go build command seems to complete without visible errors in the Docker build logs.
However, when I attempt to run the binary, I get the following error: exec format error, indicating that the binary is not built for ARM64 as expected.
When adding file whalewall to check the binary architecture, I sometimes see "file not found," suggesting the binary might not be created properly.
Expected Behavior:
I expected the binary to be built as an aarch64 executable compatible with ARM64 architecture.
Questions:
Is there an official way or any recommended settings to build WhaleWall for ARM64?
Are there any known issues with ARM64 compatibility, or are specific dependencies required for building on this architecture?
Are there any pre-built ARM64 binaries planned for future releases?
Additional Information:
Platform: Raspberry Pi 4B, ARM64 architecture
Go Version: 1.23 (in Docker base image)
WhaleWall Version: v0.2.3
Thank you for your help and any guidance you can provide for building or running WhaleWall on ARM64!
Hello! I’m trying to build WhaleWall as a Docker image for an ARM64 environment (Raspberry Pi 4B) but am encountering issues with the build process. Here’s a detailed overview of the steps I've taken and the issues I'm facing:
Steps to Reproduce:
Dockerfile:
Here’s the Dockerfile I’ve been using:
Observed Behavior:
Expected Behavior:
I expected the binary to be built as an aarch64 executable compatible with ARM64 architecture.
Questions:
Additional Information:
Thank you for your help and any guidance you can provide for building or running WhaleWall on ARM64!