Skip to content

Commit

Permalink
Add arm/v7 support (#6)
Browse files Browse the repository at this point in the history
* Add arm/v7 support

* various changes

* Move most dependency prep to separate file
  • Loading branch information
andy5995 committed Feb 8, 2024
1 parent 68c911f commit 5e76cd9
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 49 deletions.
93 changes: 83 additions & 10 deletions .github/workflows/docker.yml
Expand Up @@ -13,34 +13,107 @@ on:
schedule:
- cron: '30 11 18 * *'

env:
REGISTRY_IMAGE: andy5995/linuxdeploy

jobs:
build-image:
build:
runs-on: ubuntu-latest
name: ${{ matrix.platform }}-image
strategy:
matrix:
platform: ['linux/amd64', 'linux/arm64', 'linux/arm/v7']
fail-fast: false
steps:
-
name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
-
name: Checkout
uses: actions/checkout@v4
with:
submodules: true
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}

- if: ${{ matrix.platform != 'linux/amd64' }}
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: andy5995
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.UNCLE_ANDY_DOCKERHUB_ACCESS_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

-
name: Build and push
name: Build and push by digest
id: build
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: andy5995/linuxdeploy:latest
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
-
name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
-
name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ env.PLATFORM_PAIR }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

merge:
runs-on: ubuntu-latest
needs:
- build-dependencies-image
steps:
-
name: Download digests
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
tags: type=raw,value=latest
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.UNCLE_ANDY_DOCKERHUB_ACCESS_TOKEN }}
-
name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
-
name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
67 changes: 28 additions & 39 deletions Dockerfile
@@ -1,56 +1,45 @@
FROM ubuntu:focal
ARG DEBIAN_FRONTEND=noninteractive
RUN \
apt update && apt upgrade -y && apt install -y \
autoconf \
automake \
build-essential \
cmake \
curl \
desktop-file-utils \
fuse \
gettext \
git \
libcairo-dev \
libfuse2 \
libfuse-dev \
libgcrypt-dev \
libglib2.0-dev \
libgpgme-dev \
libjpeg-dev \
libpng-dev \
libssl-dev \
libtool \
patchelf \
python3-pip \
sudo \
wget \
xxd

RUN python3 -m pip install meson ninja
FROM andy5995/linuxdeploy:dependencies-latest
USER builder
WORKDIR /home/builder

RUN \
git clone --depth 1 --branch 1-alpha-20240109-1 https://github.com/linuxdeploy/linuxdeploy --recurse-submodules && \
cd linuxdeploy && cp src/core/copyright/copyright.h src/core && \
cmake . -G Ninja && ninja && ninja install linuxdeploy && cd .. && \
cmake . \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=$HOME/.local \
-DBUILD_TESTING=OFF \
-DINSTALL_GTEST=OFF \
-DBUILD_GMOCK=OFF && \
ninja && ninja install linuxdeploy && cd .. && \
rm -rf linuxdeploy
RUN \
git clone --depth 1 --branch 1-alpha-20230713-1 https://github.com/linuxdeploy/linuxdeploy-plugin-appimage --recurse-submodules && \
cd linuxdeploy-plugin-appimage && \
cmake . -G Ninja && ninja && ninja install && cd .. && \
cmake . -G Ninja -DCMAKE_INSTALL_PREFIX=$HOME/.local && ninja && ninja install && cd .. && \
rm -rf linuxdeploy-plugin-appimage
RUN \
git clone --depth 1 --branch 13 https://github.com/AppImage/AppImageKit --recurse-submodules && \
cd AppImageKit && \
cmake . && make -j $(nproc) && make install && cd .. && \
rm -rf AppImageKit
cd AppImageKit && \
cmake . \
-DCMAKE_INSTALL_PREFIX=$HOME/.local \
-DBUILD_GMOCK=OFF \
-DBUILD_TESTING=OFF && \
make -j $(nproc) && make install && \
cd .. && rm -rf AppImageKit
RUN wget -q https://github.com/linuxdeploy/linuxdeploy-plugin-gtk/blob/master/linuxdeploy-plugin-gtk.sh

RUN useradd -m builder && passwd -d builder
RUN echo "builder ALL=(ALL) ALL" >> /etc/sudoers
USER builder
WORKDIR /home/builder
USER root
ARG DEBIAN_FRONTEND=noninteractive
RUN \
apt update && apt upgrade -y && apt install -y \
libgtk2.0-dev \
libgtk-3-dev \
qt5-default

ENV DOCKER_BUILD=TRUE

USER builder
WORKDIR /home/builder

CMD ["/bin/bash","-l"]

0 comments on commit 5e76cd9

Please sign in to comment.