Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/Remmina/Remmina.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbhatman1441 <blackhat1441@protonmail.com>2024-01-05 17:33:14 +0300
committerbhatman1441 <blackhat1441@protonmail.com>2024-01-05 17:33:14 +0300
commit09c9d124e8ee9138e820feb98636df7c75a5632a (patch)
tree4f90d3f0a42bd8b5989850b1179a0d1f89de94ab
parent43e9ff88cab4ec6140dc113ae6e25bd304901641 (diff)
Create ubuntu 22.04 snapcraft core22 image for snap testing
-rw-r--r--ci/dockerfiles/snap-22.04/Dockerfile74
1 files changed, 74 insertions, 0 deletions
diff --git a/ci/dockerfiles/snap-22.04/Dockerfile b/ci/dockerfiles/snap-22.04/Dockerfile
new file mode 100644
index 000000000..80fa1e697
--- /dev/null
+++ b/ci/dockerfiles/snap-22.04/Dockerfile
@@ -0,0 +1,74 @@
+ARG RISK=edge
+ARG UBUNTU=jammy
+
+FROM ubuntu:$UBUNTU as builder
+ARG RISK
+ARG UBUNTU
+RUN echo "Building snapcraft:$RISK in ubuntu:$UBUNTU"
+
+# Grab dependencies
+RUN apt-get update
+RUN apt-get dist-upgrade --yes
+RUN apt-get install --yes \
+ curl \
+ jq \
+ squashfs-tools
+
+# Grab the core snap (for backwards compatibility) from the stable channel and
+# unpack it in the proper place.
+RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core' | jq '.download_url' -r) --output core.snap
+RUN mkdir -p /snap/core
+RUN unsquashfs -d /snap/core/current core.snap
+
+# Grab the core18 snap (which snapcraft uses as a base) from the stable channel
+# and unpack it in the proper place.
+RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core18' | jq '.download_url' -r) --output core18.snap
+RUN mkdir -p /snap/core18
+RUN unsquashfs -d /snap/core18/current core18.snap
+
+# Grab the core22 snap (which snapcraft uses as a base) from the stable channel
+# and unpack it in the proper place.
+RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core22' | jq '.download_url' -r) --output core22.snap
+RUN mkdir -p /snap/core22
+RUN unsquashfs -d /snap/core22/current core22.snap
+
+# Grab the snapcraft snap from the $RISK channel and unpack it in the proper
+# place.
+RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/snapcraft?channel='$RISK | jq '.download_url' -r) --output snapcraft.snap
+RUN mkdir -p /snap/snapcraft
+RUN unsquashfs -d /snap/snapcraft/current snapcraft.snap
+
+# Fix Python3 installation: Make sure we use the interpreter from
+# the snapcraft snap:
+RUN unlink /snap/snapcraft/current/usr/bin/python3
+RUN ln -s /snap/snapcraft/current/usr/bin/python3.* /snap/snapcraft/current/usr/bin/python3
+RUN echo /snap/snapcraft/current/lib/python3.*/site-packages >> /snap/snapcraft/current/usr/lib/python3/dist-packages/site-packages.pth
+
+# Create a snapcraft runner (TODO: move version detection to the core of
+# snapcraft).
+RUN mkdir -p /snap/bin
+RUN echo "#!/bin/sh" > /snap/bin/snapcraft
+RUN snap_version="$(awk '/^version:/{print $2}' /snap/snapcraft/current/meta/snap.yaml | tr -d \')" && echo "export SNAP_VERSION=\"$snap_version\"" >> /snap/bin/snapcraft
+RUN echo 'exec "$SNAP/usr/bin/python3" "$SNAP/bin/snapcraft" "$@"' >> /snap/bin/snapcraft
+RUN chmod +x /snap/bin/snapcraft
+
+# Multi-stage build, only need the snaps from the builder. Copy them one at a
+# time so they can be cached.
+FROM ubuntu:$UBUNTU
+COPY --from=builder /snap/core /snap/core
+COPY --from=builder /snap/core18 /snap/core18
+COPY --from=builder /snap/core22 /snap/core22
+COPY --from=builder /snap/snapcraft /snap/snapcraft
+COPY --from=builder /snap/bin/snapcraft /snap/bin/snapcraft
+
+# Generate locale and install dependencies.
+RUN apt-get update && apt-get dist-upgrade --yes && apt-get install --yes snapd sudo locales && locale-gen en_US.UTF-8
+
+# Set the proper environment.
+ENV LANG="en_US.UTF-8"
+ENV LANGUAGE="en_US:en"
+ENV LC_ALL="en_US.UTF-8"
+ENV PATH="/snap/bin:/snap/snapcraft/current/usr/bin:$PATH"
+ENV SNAP="/snap/snapcraft/current"
+ENV SNAP_NAME="snapcraft"
+ENV SNAP_ARCH="amd64"