Skip to content

Commit 5e76cd9

Browse files
authored
Add arm/v7 support (#6)
* Add arm/v7 support * various changes * Move most dependency prep to separate file
1 parent 68c911f commit 5e76cd9

File tree

2 files changed

+111
-49
lines changed

2 files changed

+111
-49
lines changed

.github/workflows/docker.yml

Lines changed: 83 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,107 @@ on:
1313
schedule:
1414
- cron: '30 11 18 * *'
1515

16+
env:
17+
REGISTRY_IMAGE: andy5995/linuxdeploy
18+
1619
jobs:
17-
build-image:
20+
build:
1821
runs-on: ubuntu-latest
22+
name: ${{ matrix.platform }}-image
23+
strategy:
24+
matrix:
25+
platform: ['linux/amd64', 'linux/arm64', 'linux/arm/v7']
26+
fail-fast: false
1927
steps:
28+
-
29+
name: Prepare
30+
run: |
31+
platform=${{ matrix.platform }}
32+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
2033
-
2134
name: Checkout
2235
uses: actions/checkout@v4
2336
with:
2437
submodules: true
2538
-
39+
name: Docker meta
40+
id: meta
41+
uses: docker/metadata-action@v5
42+
with:
43+
images: ${{ env.REGISTRY_IMAGE }}
44+
45+
- if: ${{ matrix.platform != 'linux/amd64' }}
2646
name: Set up QEMU
2747
uses: docker/setup-qemu-action@v3
48+
-
49+
name: Set up Docker Buildx
50+
uses: docker/setup-buildx-action@v3
2851
-
2952
name: Login to Docker Hub
3053
uses: docker/login-action@v3
3154
with:
32-
username: andy5995
55+
username: ${{ secrets.DOCKERHUB_USERNAME }}
3356
password: ${{ secrets.UNCLE_ANDY_DOCKERHUB_ACCESS_TOKEN }}
3457
-
35-
name: Set up Docker Buildx
36-
uses: docker/setup-buildx-action@v3
37-
38-
-
39-
name: Build and push
58+
name: Build and push by digest
59+
id: build
4060
uses: docker/build-push-action@v5
4161
with:
4262
context: .
4363
file: ./Dockerfile
44-
platforms: linux/amd64,linux/arm64
45-
push: true
46-
tags: andy5995/linuxdeploy:latest
64+
platforms: ${{ matrix.platform }}
65+
labels: ${{ steps.meta.outputs.labels }}
66+
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
67+
-
68+
name: Export digest
69+
run: |
70+
mkdir -p /tmp/digests
71+
digest="${{ steps.build.outputs.digest }}"
72+
touch "/tmp/digests/${digest#sha256:}"
73+
-
74+
name: Upload digest
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: digests-${{ env.PLATFORM_PAIR }}
78+
path: /tmp/digests/*
79+
if-no-files-found: error
80+
retention-days: 1
81+
82+
merge:
83+
runs-on: ubuntu-latest
84+
needs:
85+
- build-dependencies-image
86+
steps:
87+
-
88+
name: Download digests
89+
uses: actions/download-artifact@v4
90+
with:
91+
path: /tmp/digests
92+
pattern: digests-*
93+
merge-multiple: true
94+
-
95+
name: Set up Docker Buildx
96+
uses: docker/setup-buildx-action@v3
97+
-
98+
name: Docker meta
99+
id: meta
100+
uses: docker/metadata-action@v5
101+
with:
102+
images: ${{ env.REGISTRY_IMAGE }}
103+
tags: type=raw,value=latest
104+
-
105+
name: Login to Docker Hub
106+
uses: docker/login-action@v3
107+
with:
108+
username: ${{ secrets.DOCKERHUB_USERNAME }}
109+
password: ${{ secrets.UNCLE_ANDY_DOCKERHUB_ACCESS_TOKEN }}
110+
-
111+
name: Create manifest list and push
112+
working-directory: /tmp/digests
113+
run: |
114+
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
115+
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
116+
-
117+
name: Inspect image
118+
run: |
119+
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}

Dockerfile

Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,45 @@
1-
FROM ubuntu:focal
2-
ARG DEBIAN_FRONTEND=noninteractive
3-
RUN \
4-
apt update && apt upgrade -y && apt install -y \
5-
autoconf \
6-
automake \
7-
build-essential \
8-
cmake \
9-
curl \
10-
desktop-file-utils \
11-
fuse \
12-
gettext \
13-
git \
14-
libcairo-dev \
15-
libfuse2 \
16-
libfuse-dev \
17-
libgcrypt-dev \
18-
libglib2.0-dev \
19-
libgpgme-dev \
20-
libjpeg-dev \
21-
libpng-dev \
22-
libssl-dev \
23-
libtool \
24-
patchelf \
25-
python3-pip \
26-
sudo \
27-
wget \
28-
xxd
29-
30-
RUN python3 -m pip install meson ninja
1+
FROM andy5995/linuxdeploy:dependencies-latest
2+
USER builder
3+
WORKDIR /home/builder
314

325
RUN \
336
git clone --depth 1 --branch 1-alpha-20240109-1 https://github.com/linuxdeploy/linuxdeploy --recurse-submodules && \
347
cd linuxdeploy && cp src/core/copyright/copyright.h src/core && \
35-
cmake . -G Ninja && ninja && ninja install linuxdeploy && cd .. && \
8+
cmake . \
9+
-G Ninja \
10+
-DCMAKE_INSTALL_PREFIX=$HOME/.local \
11+
-DBUILD_TESTING=OFF \
12+
-DINSTALL_GTEST=OFF \
13+
-DBUILD_GMOCK=OFF && \
14+
ninja && ninja install linuxdeploy && cd .. && \
3615
rm -rf linuxdeploy
3716
RUN \
3817
git clone --depth 1 --branch 1-alpha-20230713-1 https://github.com/linuxdeploy/linuxdeploy-plugin-appimage --recurse-submodules && \
3918
cd linuxdeploy-plugin-appimage && \
40-
cmake . -G Ninja && ninja && ninja install && cd .. && \
19+
cmake . -G Ninja -DCMAKE_INSTALL_PREFIX=$HOME/.local && ninja && ninja install && cd .. && \
4120
rm -rf linuxdeploy-plugin-appimage
4221
RUN \
4322
git clone --depth 1 --branch 13 https://github.com/AppImage/AppImageKit --recurse-submodules && \
44-
cd AppImageKit && \
45-
cmake . && make -j $(nproc) && make install && cd .. && \
46-
rm -rf AppImageKit
23+
cd AppImageKit && \
24+
cmake . \
25+
-DCMAKE_INSTALL_PREFIX=$HOME/.local \
26+
-DBUILD_GMOCK=OFF \
27+
-DBUILD_TESTING=OFF && \
28+
make -j $(nproc) && make install && \
29+
cd .. && rm -rf AppImageKit
4730
RUN wget -q https://github.com/linuxdeploy/linuxdeploy-plugin-gtk/blob/master/linuxdeploy-plugin-gtk.sh
4831

49-
RUN useradd -m builder && passwd -d builder
50-
RUN echo "builder ALL=(ALL) ALL" >> /etc/sudoers
51-
USER builder
52-
WORKDIR /home/builder
32+
USER root
33+
ARG DEBIAN_FRONTEND=noninteractive
34+
RUN \
35+
apt update && apt upgrade -y && apt install -y \
36+
libgtk2.0-dev \
37+
libgtk-3-dev \
38+
qt5-default
5339

5440
ENV DOCKER_BUILD=TRUE
5541

42+
USER builder
43+
WORKDIR /home/builder
44+
5645
CMD ["/bin/bash","-l"]

0 commit comments

Comments
 (0)