|
| 1 | +# Base image with workdir and apt (update/install) caching |
| 2 | +FROM ubuntu AS base |
| 3 | + |
| 4 | +WORKDIR /opt/hhg-studio |
| 5 | + |
| 6 | +RUN <<EOT |
| 7 | +rm -f /etc/apt/apt.conf.d/docker-clean |
| 8 | +echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache |
| 9 | +EOT |
| 10 | + |
| 11 | +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ |
| 12 | + --mount=type=cache,target=/var/lib/apt,sharing=locked \ |
| 13 | + apt update |
| 14 | + |
| 15 | + |
| 16 | +# Stage for pulling the hhg-studio snap package and |
| 17 | +# extracting the squashfs root |
| 18 | +FROM base AS snap |
| 19 | + |
| 20 | +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ |
| 21 | + --mount=type=cache,target=/var/lib/apt,sharing=locked \ |
| 22 | + apt update && apt install --no-install-recommends -y snapd squashfs-tools |
| 23 | + |
| 24 | +RUN snap download hhg-studio |
| 25 | + |
| 26 | +RUN unsquashfs hhg-studio_*.snap |
| 27 | + |
| 28 | + |
| 29 | +FROM base |
| 30 | + |
| 31 | +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ |
| 32 | + --mount=type=cache,target=/var/lib/apt,sharing=locked \ |
| 33 | + apt update && apt install -y --no-install-recommends qtbase5-dev libpng-dev libglib2.0-dev |
| 34 | + |
| 35 | +COPY --from=snap /opt/hhg-studio/squashfs-root ./squashfs-root |
| 36 | + |
| 37 | +# Define environment vars used by snap (launch.sh script) |
| 38 | +#ENV WAYLAND_DISABLE=1 |
| 39 | +#ENV QT_DEBUG_PLUGINS=1 |
| 40 | +ENV SNAP_ARCH=amd64 |
| 41 | +ENV RUNTIME=/opt/hhg-studio/squashfs-root |
| 42 | +ENV SNAP=/opt/hhg-studio/squashfs-root |
| 43 | +ENV SNAP_USER_COMMON=/tmp/hhg-studio/common |
| 44 | +ENV SNAP_USER_DATA=/tmp/hhg-studio/home |
| 45 | + |
| 46 | +RUN <<EOT |
| 47 | +cp /opt/hhg-studio/squashfs-root/usr/share/glib-2.0/schemas/* /usr/share/glib-2.0/schemas/. |
| 48 | +glib-compile-schemas /usr/share/glib-2.0/schemas/ |
| 49 | +EOT |
| 50 | + |
| 51 | +ENTRYPOINT ["/opt/hhg-studio/squashfs-root/bin/desktop-launch", "/opt/hhg-studio/squashfs-root/usr/local/bin/hhg-studio"] |
| 52 | + |
0 commit comments