Last active
August 29, 2025 04:59
-
-
Save njreid/eaedc91db88cef74e144f28c92e9d416 to your computer and use it in GitHub Desktop.
Dockerfile to cross-compiled Wails+Golang apps for Arm64 Raspberry Pi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker build -t arm64-cross-compiler-image --platform linux/arm64 . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Use an ARM64 base image (e.g., Ubuntu for ARM64) | |
| FROM dtcooper/raspberrypi-os:bookworm | |
| # Set environment variables for cross-compilation | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # Install necessary build tools, cross-compilers, and Wails dependencies | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| gcc-aarch64-linux-gnu \ | |
| g++-aarch64-linux-gnu \ | |
| libc6-dev-arm64-cross \ | |
| curl \ | |
| wget \ | |
| ca-certificates \ | |
| pkg-config \ | |
| libwebkit2gtk-4.0-dev \ | |
| libgtk-3-dev \ | |
| libwebkit2gtk-4.0-37 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install Node.js and npm (latest) | |
| RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \ | |
| apt-get install -y nodejs | |
| # Install Go (latest) | |
| RUN wget https://go.dev/dl/go1.25.0.linux-arm64.tar.gz && \ | |
| tar -C /usr/local -xzf go1.25.0.linux-arm64.tar.gz && \ | |
| rm go1.25.0.linux-arm64.tar.gz | |
| # Set Go environment variables | |
| ENV GOPATH=/go | |
| ENV GOBIN=$GOPATH/bin | |
| ENV PATH=$PATH:$GOBIN | |
| # Install wails CLI | |
| RUN go install github.com/wailsapp/wails/v2/cmd/wails@latest | |
| # Set the working directory | |
| WORKDIR /app | |
| # Copy your source code into the container (optional, can be mounted later) | |
| # COPY . /app | |
| # Define a default command (optional) | |
| # CMD ["bash"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment