Skip to content

Commit

Permalink
Switch to bullseye base image
Browse files Browse the repository at this point in the history
* Debian bookwarm is causing GCC to load incorrect header file for some reasons (beyond my expertise at this stage)
  • Loading branch information
abjrcode committed Oct 27, 2023
1 parent ae486de commit 8f17e5a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ jobs:
with:
fetch-depth: 1

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand Down
35 changes: 22 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
# Adopted from Go Releaser Toolchain
# https://github.com/goreleaser/goreleaser-cross-toolchains/blob/main/Dockerfile

ARG GO_VERSION=1.21.1

FROM --platform=$BUILDPLATFORM golang:${GO_VERSION} as builder
FROM --platform=$BUILDPLATFORM debian:bullseye as builder

LABEL maintainer="Ibrahim Najjar <https://github.com/abjrcode/>"
LABEL "org.opencontainers.image.source"="https://github.com/abjrcode/cross-wails"
Expand All @@ -35,19 +34,24 @@ LABEL "org.opencontainers.image.source"="https://github.com/abjrcode/cross-wails
ARG TARGETARCH

ENV DEBIAN_FRONTEND=noninteractive
ARG DPKG_ARCH="amd64 arm64 i386"
ARG DPKG_ARCH="amd64 arm64"
ARG CROSSBUILD_ARCH="amd64 arm64"
ARG MINGW_VERSION=20230130
ARG MINGW_HOST="ubuntu-22.04"
ARG MINGW_HOST="ubuntu-18.04"

SHELL ["/bin/bash", "-c"]

RUN set -x; \
while read arch; do dpkg --add-architecture $arch; done < <(echo "${DPKG_ARCH}" | tr ' ' '\n') \
apt-get update \
&& apt-get install --no-install-recommends -y -qq \
wget \
ca-certificates \
gnupg \
nsis \
&& while read arch; do dpkg --add-architecture $arch; done < <(echo "${DPKG_ARCH}" | tr ' ' '\n') \
&& crossbuild_pkgs=$(while read arch; do echo -n "crossbuild-essential-$arch "; done < <(echo "${CROSSBUILD_ARCH}" | tr ' ' '\n')) \
&& apt-get update \
&& apt-get install --no-install-recommends -y -q \
libc6-dev \
&& apt-get install --no-install-recommends -y -qq \
gcc \
libarchive-tools \
mingw-w64 \
Expand All @@ -65,18 +69,23 @@ RUN dpkg --add-architecture arm64 \
&& apt-get -qq update \
&& apt-get -qq install -y libgtk-3-dev:arm64 libwebkit2gtk-4.0-dev:arm64

# NSIS is only needed for Windows, so we install the one that matches the build platform
RUN apt-get -qq install -y nsis

ARG NODE_MAJOR_VERSION=18

# Install NodeJS
RUN apt-get -qq install -y ca-certificates curl gnupg && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
RUN mkdir -p /etc/apt/keyrings && \
wget -q -O - https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR_VERSION.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get -qq update && apt-get -qq install nodejs -y


# Install Go
ARG GO_VERSION=1.21.3
RUN wget https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz \
&& rm -rf /usr/local/go && tar -C /usr/local -xzf go${GO_VERSION}.linux-${TARGETARCH}.tar.gz \
&& rm go${GO_VERSION}.linux-${TARGETARCH}.tar.gz

ENV PATH=$PATH:/root/go/bin:/usr/local/go/bin

RUN apt -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Cross Wails

Docker Image for Cross Compiling Wails Applications
Docker Image for Cross Compiling [Wails Applications](https://wails.io/)

## Usage

```dockerfile
FROM ghcr.io/abjrcode/wails-cross:latest
FROM ghcr.io/abjrcode/wails-cross:v2.6.0
```

## Details
Expand Down

0 comments on commit 8f17e5a

Please sign in to comment.