diff --git a/images/linux/scripts/base/repos.sh b/images/linux/scripts/base/repos.sh index f8280cc06..4ecd2028c 100644 --- a/images/linux/scripts/base/repos.sh +++ b/images/linux/scripts/base/repos.sh @@ -9,7 +9,11 @@ LSB_RELEASE=$(lsb_release -rs) # Install Microsoft repository wget https://packages.microsoft.com/config/ubuntu/$LSB_RELEASE/packages-microsoft-prod.deb dpkg -i packages-microsoft-prod.deb -apt-get update +apt-get install -y apt-transport-https ca-certificates curl software-properties-common # Install Microsoft GPG public key curl -L https://packages.microsoft.com/keys/microsoft.asc | apt-key add - + +curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg +mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg +apt-get update \ No newline at end of file diff --git a/images/linux/scripts/installers/1604/powershellcore.sh b/images/linux/scripts/installers/1604/powershellcore.sh index 8ace4742c..5c615ae31 100644 --- a/images/linux/scripts/installers/1604/powershellcore.sh +++ b/images/linux/scripts/installers/1604/powershellcore.sh @@ -7,8 +7,6 @@ # Source the helpers for use with the script source $HELPER_SCRIPTS/document.sh -LSB_RELEASE=$(lsb_release -rs) - # Install Powershell apt-get install -y powershell diff --git a/images/linux/scripts/installers/1804/dotnetcore-sdk.sh b/images/linux/scripts/installers/1804/dotnetcore-sdk.sh deleted file mode 100644 index b2081510d..000000000 --- a/images/linux/scripts/installers/1804/dotnetcore-sdk.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/bash -################################################################################ -## File: dotnetcore-sdk.sh -## Desc: Installs .NET Core SDK -################################################################################ - -source $HELPER_SCRIPTS/apt.sh -source $HELPER_SCRIPTS/document.sh - -LATEST_DOTNET_PACKAGES=("dotnet-sdk-3.0" "dotnet-sdk-3.1") - -LSB_RELEASE=$(lsb_release -rs) - -mksamples() -{ - sdk=$1 - sample=$2 - mkdir "$sdk" - cd "$sdk" || exit - set -e - dotnet help - dotnet new globaljson --sdk-version "$sdk" - dotnet new "$sample" - dotnet restore - dotnet build - set +e - cd .. || exit - rm -rf "$sdk" -} - -set -e - -# Disable telemetry -export DOTNET_CLI_TELEMETRY_OPTOUT=1 - -for latest_package in ${LATEST_DOTNET_PACKAGES[@]}; do - echo "Determing if .NET Core ($latest_package) is installed" - if ! IsInstalled $latest_package; then - echo "Could not find .NET Core ($latest_package), installing..." - curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg - mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg - sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod bionic main" > /etc/apt/sources.list.d/dotnetdev.list' - apt-get install apt-transport-https - apt-get update - #temporary avoid 3.1.102 installation due to https://github.com/dotnet/aspnetcore/issues/19133 - if [ $latest_package != "dotnet-sdk-3.1" ]; then - apt-get install $latest_package -y - else - apt-get install dotnet-sdk-3.1=3.1.101-1 -y - fi - else - echo ".NET Core ($latest_package) is already installed" - fi -done - -# Get list of all released SDKs from channels which are not end-of-life or preview -release_urls=("https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.1/releases.json" "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.2/releases.json" "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/3.0/releases.json" "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/3.1/releases.json") -sdks=() -for release_url in ${release_urls[@]}; do - echo "${release_url}" - releases=$(curl "${release_url}") - sdks=("${sdks[@]}" $(echo "${releases}" | jq '.releases[]' | jq '.sdk.version')) - sdks=("${sdks[@]}" $(echo "${releases}" | jq '.releases[]' | jq '.sdks[]?' | jq '.version')) -done - -#temporary avoid 3.1.102 installation due to https://github.com/dotnet/aspnetcore/issues/19133 -sortedSdks=$(echo ${sdks[@]} | tr ' ' '\n' | grep -v 3.1.102 | grep -v preview | grep -v rc | grep -v display | cut -d\" -f2 | sort -u -r) - -for sdk in $sortedSdks; do - url="https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$sdk/dotnet-sdk-$sdk-linux-x64.tar.gz" - echo "$url" >> urls - echo "Adding $url to list to download later" -done - -# Download additional SDKs -echo "Downloading release tarballs..." -cat urls | xargs -n 1 -P 16 wget -q -for tarball in *.tar.gz; do - dest="./tmp-$(basename -s .tar.gz $tarball)" - echo "Extracting $tarball to $dest" - mkdir "$dest" && tar -C "$dest" -xzf "$tarball" - rsync -qav "$dest/shared/" /usr/share/dotnet/shared/ - rsync -qav "$dest/host/" /usr/share/dotnet/host/ - rsync -qav "$dest/sdk/" /usr/share/dotnet/sdk/ - rm -rf "$dest" - rm "$tarball" -done -rm urls - -DocumentInstalledItem ".NET Core SDK:" -# Smoke test each SDK -for sdk in $sortedSdks; do - mksamples "$sdk" "console" - mksamples "$sdk" "mstest" - mksamples "$sdk" "xunit" - mksamples "$sdk" "web" - mksamples "$sdk" "mvc" - mksamples "$sdk" "webapi" - DocumentInstalledItemIndent "$sdk" -done - -# NuGetFallbackFolder at /usr/share/dotnet/sdk/NuGetFallbackFolder is warmed up by smoke test -# Additional FTE will just copy to ~/.dotnet/NuGet which provides no benefit on a fungible machine -echo "DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1" | tee -a /etc/environment -echo 'export PATH="$PATH:$HOME/.dotnet/tools"' | tee -a /etc/skel/.bashrc diff --git a/images/linux/scripts/installers/1804/powershellcore.sh b/images/linux/scripts/installers/1804/powershellcore.sh index 72ccdfa90..2f1922493 100644 --- a/images/linux/scripts/installers/1804/powershellcore.sh +++ b/images/linux/scripts/installers/1804/powershellcore.sh @@ -7,7 +7,6 @@ # Source the helpers for use with the script source $HELPER_SCRIPTS/document.sh -LSB_RELEASE=$(lsb_release -rs) # libicu64, which comes with php-intl module, has powershell breaking issue https://github.com/PowerShell/PowerShell/issues/9746 # Fix - install additional libicu65 where the issue is fixed echo "install libicu65" diff --git a/images/linux/scripts/installers/docker-moby.sh b/images/linux/scripts/installers/docker-moby.sh index 625c93cfa..f84e495f1 100644 --- a/images/linux/scripts/installers/docker-moby.sh +++ b/images/linux/scripts/installers/docker-moby.sh @@ -15,10 +15,6 @@ if ! IsInstalled $docker_package; then echo "Docker ($docker_package) was not found. Installing..." apt-get remove -y moby-engine moby-cli apt-get update - apt-get install -y apt-transport-https ca-certificates curl software-properties-common - curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - - curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/microsoft-prod.list - apt-get update apt-get install -y moby-engine moby-cli else echo "Docker ($docker_package) is already installed" diff --git a/images/linux/scripts/installers/docker.sh b/images/linux/scripts/installers/docker.sh index b7fb84e6a..e96e5ab17 100644 --- a/images/linux/scripts/installers/docker.sh +++ b/images/linux/scripts/installers/docker.sh @@ -12,8 +12,6 @@ DOCKER_PACKAGE=moby apt-get remove -y moby-engine mobi-cli apt-get update -apt-get install -y apt-transport-https ca-certificates curl software-properties-common -apt-get update apt-get install -y moby-engine mobi-cli docker pull node:10 diff --git a/images/linux/scripts/installers/1604/dotnetcore-sdk.sh b/images/linux/scripts/installers/dotnetcore-sdk.sh similarity index 98% rename from images/linux/scripts/installers/1604/dotnetcore-sdk.sh rename to images/linux/scripts/installers/dotnetcore-sdk.sh index c0d48dfdd..d0e138103 100644 --- a/images/linux/scripts/installers/1604/dotnetcore-sdk.sh +++ b/images/linux/scripts/installers/dotnetcore-sdk.sh @@ -3,7 +3,6 @@ ## File: dotnetcore-sdk.sh ## Desc: Installs .NET Core SDK ################################################################################ - source $HELPER_SCRIPTS/apt.sh source $HELPER_SCRIPTS/document.sh @@ -30,6 +29,9 @@ mksamples() set -e +# Disable telemetry +export DOTNET_CLI_TELEMETRY_OPTOUT=1 + for latest_package in ${LATEST_DOTNET_PACKAGES[@]}; do echo "Determing if .NET Core ($latest_package) is installed" if ! IsInstalled $latest_package; then diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index c83f40c3c..e303746be 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -131,7 +131,7 @@ "{{template_dir}}/scripts/installers/docker-compose.sh", "{{template_dir}}/scripts/installers/docker-moby.sh", "{{template_dir}}/scripts/installers/docker.sh", - "{{template_dir}}/scripts/installers/1604/dotnetcore-sdk.sh", + "{{template_dir}}/scripts/installers/dotnetcore-sdk.sh", "{{template_dir}}/scripts/installers/erlang.sh", "{{template_dir}}/scripts/installers/firefox.sh", "{{template_dir}}/scripts/installers/gcc.sh", diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 67c833b76..1492d4b54 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -134,7 +134,7 @@ "{{template_dir}}/scripts/installers/docker-compose.sh", "{{template_dir}}/scripts/installers/docker-moby.sh", "{{template_dir}}/scripts/installers/docker.sh", - "{{template_dir}}/scripts/installers/1804/dotnetcore-sdk.sh", + "{{template_dir}}/scripts/installers/dotnetcore-sdk.sh", "{{template_dir}}/scripts/installers/erlang.sh", "{{template_dir}}/scripts/installers/firefox.sh", "{{template_dir}}/scripts/installers/gcc.sh",