Skip to content

Commit 8cfc8ce

Browse files
committed
chore(linux): Improved Flatpak builds.
1 parent 38a608b commit 8cfc8ce

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

flatpak/Dockerfile

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
FROM ubuntu:24.04
22

3+
ARG UID=1000
4+
ARG GID=1000
5+
6+
RUN groupadd --non-unique -g ${GID} auser && \
7+
useradd --non-unique --no-create-home -u ${UID} -g ${GID} auser || \
8+
usermod -u ${UID} -g ${GID} $(getent passwd ${UID} | cut -d: -f1) && \
9+
groupmod -g ${GID} $(getent group ${GID} | cut -d: -f1)
10+
311
RUN apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Europe apt-get -y install tzdata
412
RUN apt-get -y install tree curl file git unzip xz-utils zip clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
513
RUN apt-get -y install libsecret-1-dev libpolkit-gobject-1-dev
@@ -9,8 +17,23 @@ RUN flatpak install -y org.freedesktop.Sdk/x86_64/25.08
917
RUN flatpak install -y org.freedesktop.Platform/x86_64/25.08
1018
RUN flatpak install -y flathub org.freedesktop.appstream-glib
1119

12-
RUN git clone https://github.com/flutter/flutter.git -b stable /opt/flutter
13-
ENV PATH="/opt/flutter/bin:${PATH}"
14-
RUN git config --global --add safe.directory /opt/flutter
15-
RUN flutter --disable-analytics && flutter upgrade
16-
RUN chown -R "$(id -u):$(id -g)" /opt/flutter
20+
RUN mkdir -p /home/auser
21+
RUN chown -R ${UID}:${GID} /home/auser
22+
USER ${UID}
23+
ENV HOME=/home/auser
24+
WORKDIR /home/auser
25+
26+
RUN git clone https://github.com/flutter/flutter.git -b stable /home/auser/flutter
27+
ENV PATH="$PATH:/home/auser/flutter/bin:/home/auser/flutter/bin/cache/dart-sdk/bin"
28+
RUN flutter --disable-analytics
29+
RUN flutter config --enable-linux-desktop \
30+
--no-enable-windows-desktop \
31+
--no-enable-macos-desktop \
32+
--no-enable-web \
33+
--no-enable-android \
34+
--no-enable-ios
35+
RUN flutter precache
36+
RUN flutter upgrade
37+
RUN chown -R ${UID}:${GID} /home/auser/flutter
38+
39+
RUN git config --global --add safe.directory /home/auser/flutter

0 commit comments

Comments
 (0)