Skip to content

Commit

Permalink
update docker image to use 18.04
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisEz13 committed Mar 25, 2019
1 parent c9a62ef commit f5818f6
Showing 1 changed file with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Docker image file that describes an Ubuntu16.04 image with PowerShell and SnapCraft installed from Microsoft APT Repo
FROM snapcore/snapcraft:stable
FROM ubuntu:18.04


RUN apt-get update && \
apt-get dist-upgrade --yes && \
apt-get install --yes \
curl sudo jq squashfs-tools && \
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 && \
curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/snapcraft?channel=edge' | jq '.download_url' -r) --output snapcraft.snap && \
mkdir -p /snap/snapcraft && unsquashfs -d /snap/snapcraft/current snapcraft.snap && rm snapcraft.snap && \
apt remove --yes --purge jq squashfs-tools && \
apt-get autoclean --yes && \
apt-get clean --yes

COPY bin/snapcraft-wrapper /snap/bin/snapcraft

ENV PATH=/snap/bin:$PATH

# Install apt-utils (for apt-key used later)
# Install ca-certificates so we can use ssl
Expand All @@ -11,13 +28,12 @@ RUN apt-get update && \
apt-get install -y --no-install-recommends \
apt-utils \
ca-certificates \
curl \
apt-transport-https \
git && \
# Import the public repository GPG keys for Microsoft
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
# Register the Microsoft Ubuntu 16.04 repository with apt
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | tee /etc/apt/sources.list.d/microsoft.list && \
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | tee /etc/apt/sources.list.d/microsoft.list && \
# Update after register new repo
apt-get update && \
# Install Powershell
Expand All @@ -26,7 +42,7 @@ RUN apt-get update && \
# Clean up so the layer is small
apt remove --yes --purge apt-utils apt-transport-https && \
apt-get autoclean --yes && \
apt-get clean --yes && \
apt-get clean --yes && \
rm /etc/apt/sources.list.d/microsoft.list

COPY powershell-snap.ps1 /powershell-snap.ps1
Expand Down

0 comments on commit f5818f6

Please sign in to comment.