Loading Dockerfile +3 −43 Original line number Diff line number Diff line FROM ubuntu:bionic as builder FROM snapcore/snapcraft:stable as builder # 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 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=5.x/stable' | jq '.download_url' -r) --output snapcraft.snap RUN mkdir -p /snap/snapcraft RUN unsquashfs -d /snap/snapcraft/current snapcraft.snap # 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 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:bionic COPY --from=builder /snap/core /snap/core COPY --from=builder /snap/core18 /snap/core18 COPY --from=builder /snap/snapcraft /snap/snapcraft COPY --from=builder /snap/bin/snapcraft /snap/bin/snapcraft RUN apt-get update RUN apt-get install --yes \ nsis \ rsync # Generate locale. RUN apt-get update && apt-get dist-upgrade --yes && apt-get install --yes sudo locales && locale-gen en_US.UTF-8 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" Loading @@ -59,4 +19,4 @@ ENV SNAP="/snap/snapcraft/current" ENV SNAP_NAME="snapcraft" ENV SNAP_ARCH="amd64" RUN apt-get install -y openjdk-11-jdk snapd RUN apt-get install -y openjdk-11-jdk nsis rsync No newline at end of file Loading
Dockerfile +3 −43 Original line number Diff line number Diff line FROM ubuntu:bionic as builder FROM snapcore/snapcraft:stable as builder # 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 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=5.x/stable' | jq '.download_url' -r) --output snapcraft.snap RUN mkdir -p /snap/snapcraft RUN unsquashfs -d /snap/snapcraft/current snapcraft.snap # 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 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:bionic COPY --from=builder /snap/core /snap/core COPY --from=builder /snap/core18 /snap/core18 COPY --from=builder /snap/snapcraft /snap/snapcraft COPY --from=builder /snap/bin/snapcraft /snap/bin/snapcraft RUN apt-get update RUN apt-get install --yes \ nsis \ rsync # Generate locale. RUN apt-get update && apt-get dist-upgrade --yes && apt-get install --yes sudo locales && locale-gen en_US.UTF-8 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" Loading @@ -59,4 +19,4 @@ ENV SNAP="/snap/snapcraft/current" ENV SNAP_NAME="snapcraft" ENV SNAP_ARCH="amd64" RUN apt-get install -y openjdk-11-jdk snapd RUN apt-get install -y openjdk-11-jdk nsis rsync No newline at end of file