Commit fe9163f1 authored by Johan Lorenzo's avatar Johan Lorenzo
Browse files

Bug 1616048 - Fix firefox-snap docker image r=rail

Differential Revision: https://phabricator.services.mozilla.com/D63077

--HG--
extra : moz-landing-system : lando
parent 52cd30df
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -29,19 +29,28 @@ ENV SNAP="/snap/snapcraft/current"
ENV SNAP_NAME="snapcraft"
ENV SNAP_ARCH="amd64"

# Grab the core snap from the stable channel and unpack it in the proper place
# 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 && \
    mkdir -p /snap/core && \
    unsquashfs -d /snap/core/current core.snap && \
    rm core.snap

# Grab the snapcraft snap from the stable channel and unpack it in the proper place
# 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 snapcraft snap 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/snapcraft?channel=stable' | jq '.download_url' -r) --output snapcraft.snap && \
    mkdir -p /snap/snapcraft && \
    unsquashfs -d /snap/snapcraft/current snapcraft.snap && \
    rm snapcraft.snap

# Create a snapcraft runner (TODO: move version detection to the core of snapcraft)
# 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)" && echo "export SNAP_VERSION=\"$snap_version\"" >> /snap/bin/snapcraft