-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
150 lines (137 loc) · 4.84 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
ARG CODENAME=jammy
FROM ubuntu:$CODENAME
ARG CODENAME=jammy
ARG DEBIAN_FRONTEND=noninteractive
RUN \
apt update && apt upgrade -y && apt install --no-install-recommends -y \
autoconf \
automake \
build-essential \
ca-certificates \
curl \
desktop-file-utils \
fuse \
gettext \
gpg \
git \
libcairo-dev \
libcurl4-gnutls-dev \
libfuse2 \
libfuse-dev \
libgcrypt-dev \
libglib2.0-dev \
libgpgme-dev \
libjpeg-dev \
libpng-dev \
libssl-dev \
libtool \
libzstd-dev \
patchelf \
python3-pip \
sudo \
wget \
xxd \
zsync && \
update-ca-certificates -f && \
rm -rf /var/lib/apt/lists
RUN useradd -m builder && passwd -d builder
RUN echo "builder ALL=(ALL) ALL" >> /etc/sudoers
WORKDIR /home/builder
# This would get downloaded during the linuxdeploy cmake config,
# but we'll do it here to potentially help things along
RUN \
git clone --depth=1 --branch v.3.3.3 https://github.com/GreycLab/CImg && \
mv CImg/CImg.h /usr/include && \
rm -rf CImg
USER builder
RUN \
export CODENAME=$CODENAME && \
test -f /usr/share/doc/kitware-archive-keyring/copyright || \
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \
echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $CODENAME main" | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null && \
sudo apt update && \
sudo apt install -y kitware-archive-keyring && \
echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $CODENAME-rc main" | sudo tee -a /etc/apt/sources.list.d/kitware.list >/dev/null && \
sudo apt update && \
# The linuxdeploy cmake requires 3.2, but compatibility with CMake < 3.5 has been
# removed from CMake as of 4.0.0
UBUNTU_VERSION=$(grep '^VERSION_ID=' /etc/os-release | cut -d'"' -f2) && \
VERSION="3.31.6-0kitware1ubuntu${UBUNTU_VERSION}.1" && \
sudo apt-get update && \
sudo apt-get install -y cmake=${VERSION} cmake-data=${VERSION} && \
sudo apt-mark hold cmake cmake-data && \
sudo rm -rf /var/lib/apt/lists
# So pip will not report about the path...
ENV PATH=/home/builder/.local/bin:$PATH
RUN \
python3 -m pip install pip --upgrade --user && \
python3 -m pip install meson ninja --upgrade --user
WORKDIR /home/builder
RUN \
git clone --depth 1 --branch 1-alpha-20250213-2 https://github.com/linuxdeploy/linuxdeploy --recurse-submodules && \
cd linuxdeploy && cp src/core/copyright/copyright.h src/core && \
cmake . \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=$HOME/.local \
-DBUILD_TESTING=OFF \
-DINSTALL_GTEST=OFF \
-DBUILD_GMOCK=OFF \
-DCMAKE_BUILD_TYPE=Release && \
ninja && ninja install linuxdeploy && cd .. && \
rm -rf linuxdeploy
RUN \
git clone --depth 1 --branch 1-alpha-20250213-1 https://github.com/linuxdeploy/linuxdeploy-plugin-appimage --recurse-submodules && \
cd linuxdeploy-plugin-appimage && \
cmake . \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=$HOME/.local \
-DCMAKE_BUILD_TYPE=Release && \
ninja && ninja install && cd .. && \
rm -rf linuxdeploy-plugin-appimage
ARG CODENAME
RUN \
git clone --depth 1 --branch continuous https://github.com/AppImage/appimagetool.git && \
cd appimagetool && \
cmake . \
-DCMAKE_INSTALL_PREFIX=$HOME/.local \
-DCMAKE_BUILD_TYPE=Release && \
make install && \
sed -i 's@wget https://github.com/plougher/squashfs-tools/archive/refs/tags/"$version".tar.gz -qO - | tar xvz --strip-components=1@curl -sL https://github.com/plougher/squashfs-tools/archive/refs/tags/"$version".tar.gz | tar xvz --strip-components=1@' ci/install-static-mksquashfs.sh && \
sudo bash -euxo pipefail ci/install-static-mksquashfs.sh 4.6.1 && \
cd .. && rm -rf appimagetool
WORKDIR /home/builder/.local/bin
RUN \
curl -LO https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/3b67a1d1c1b0c8268f57f2bce40fe2d33d409cea/linuxdeploy-plugin-gtk.sh && \
chmod +x linuxdeploy-plugin-gtk.sh
USER root
ARG DEBIAN_FRONTEND=noninteractive
RUN \
apt update && \
apt install --no-install-recommends -y \
libgtk2.0-dev \
libgtk-3-dev \
nlohmann-json3-dev \
qtbase5-dev && \
rm -rf /var/lib/apt/lists
USER builder
WORKDIR /home/builder
RUN \
git clone \
--branch 1-alpha-20250213-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"]