Skip to content

Commit

Permalink
Add more platforms to main Dockerfile
Browse files Browse the repository at this point in the history
This also adds linuxdeploy-plugin-qt

Fixes #7
  • Loading branch information
andy5995 committed Feb 11, 2024
1 parent 2e5a781 commit 89c6363
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ jobs:
name: ${{ matrix.platform }}-image
strategy:
matrix:
platform: ['linux/amd64', 'linux/arm64', 'linux/arm/v7']
platform:
- linux/amd64
- linux/arm64
- linux/arm/v7
- linux/ppc64le
- linux/s390x
fail-fast: true
steps:
-
Expand Down
33 changes: 29 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,44 @@ RUN \
-DBUILD_TESTING=OFF && \
make -j $(nproc) && make install && \
cd .. && rm -rf AppImageKit
RUN curl -LO https://github.com/linuxdeploy/linuxdeploy-plugin-gtk/blob/master/linuxdeploy-plugin-gtk.sh

WORKDIR /home/builder/.local/bin
RUN \
curl -LO https://github.com/linuxdeploy/linuxdeploy-plugin-gtk/raw/97290a3e374381e9fa7983ba098729a37076f3ed/linuxdeploy-plugin-gtk.sh && \
chmod +x linuxdeploy-plugin-gtk.sh


USER root
ARG DEBIAN_FRONTEND=noninteractive
RUN \
apt update && apt upgrade -y && apt install -y \
libgtk2.0-dev \
libgtk-3-dev \
nlohmann-json3-dev \
qt5-default

ENV DOCKER_BUILD=TRUE

USER builder
WORKDIR /home/builder
RUN \
git clone \
--branch 1-alpha-20240109-1 \
--depth 1 \
https://github.com/linuxdeploy/linuxdeploy-plugin-qt \
--recurse-submodules && \
cd linuxdeploy-plugin-qt && \
cmake . \
-G Ninja \
-DBUILD_GMOCK=OFF \
-DBUILD_TESTING=OFF \
-DINSTALL_GTEST=OFF \
-DCMAKE_INSTALL_PREFIX=$HOME/.local && \
ninja && ninja install && \
cd .. && rm -rf linuxdeploy-plugin-qt

ENV DOCKER_BUILD=TRUE

USER root
WORKDIR /
ADD entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

CMD ["/bin/bash","-l"]
16 changes: 16 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

OLDPWD=$PWD

if [ -z "HOSTUID" ]; then
echo "HOSTUID is not set."
exit 1
fi

if [ -z "$1" ]; then
echo "One argument required -- the name of a script to run."
exit 1
fi

usermod -u $HOSTUID builder
su builder -c "PATH=/home/builder/.local/bin:$PATH && cd $OLDPWD && $1"

0 comments on commit 89c6363

Please sign in to comment.