From 2047f01379c3c960a3b74d59d5faf33092f60887 Mon Sep 17 00:00:00 2001 From: Matt Craddock <5796417+craddm@users.noreply.github.com> Date: Mon, 30 Oct 2023 12:06:41 +0000 Subject: [PATCH 1/2] Update devcontainer Az and Pwsh versions --- .devcontainer/Dockerfile | 57 +++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 4a852d8499..d246b0a417 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -2,34 +2,49 @@ ARG VARIANT=3.10 FROM python:${VARIANT}-buster RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install --no-install-recommends libssl-dev git python3-sphinx - + && apt-get -y install --no-install-recommends apt-transport-https \ + ca-certificates \ + curl \ + git \ + gnupg \ + libssl-dev \ + lsb-release \ + python3-sphinx \ + sudo + # Set package versions -ARG AZURE_CLI_VERSION="2.42.0" -ARG PWSH_VERSION="7.3.6" - -# Set up TARGETARCH variable to use to pull the right binaries for the current architecture. -ARG TARGETARCH +ARG AZURE_CLI_VERSION="2.53.1" +ARG PWSH_VERSION="7.3.9" # Install Azure-CLI -# Standard install method currently does not support ARM64 -# Use pip instead - https://github.com/Azure/azure-cli/issues/22875 -RUN pip3 install azure-cli==${AZURE_CLI_VERSION} +# Get Microsoft signing key +RUN sudo mkdir -p /etc/apt/keyrings \ + && curl -sLS https://packages.microsoft.com/keys/microsoft.asc | \ + gpg --dearmor | \ + sudo tee /etc/apt/keyrings/microsoft.gpg > /dev/null \ + && sudo chmod go+r /etc/apt/keyrings/microsoft.gpg \ + && AZ_DIST=$(lsb_release -cs) \ + && echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/azure-cli/ $AZ_DIST main" | \ + sudo tee /etc/apt/sources.list.d/azure-cli.list \ + && sudo apt-get update \ + && sudo apt-get install azure-cli=$AZURE_CLI_VERSION-1~$AZ_DIST # Install Powershell # Pull different binaries from Github depending on system architecture # The standard APT method currently only works for `amd64` - RUN if [ "${TARGETARCH}" = "arm64" ]; \ - then \ - DEBARCH="arm64"; \ - else \ - DEBARCH="x86"; \ - fi; \ - curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v${PWSH_VERSION}/powershell-${PWSH_VERSION}-linux-$DEBARCH.tar.gz \ - && mkdir -p /opt/microsoft/powershell/7 \ - && tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/7 \ - && chmod +x /opt/microsoft/powershell/7/pwsh \ - && ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh +# Set up TARGETARCH variable to use to pull the right binaries for the current architecture. +ARG TARGETARCH +RUN if [ "${TARGETARCH}" = "arm64" ]; \ + then \ + DEBARCH="arm64"; \ + else \ + DEBARCH="x86"; \ + fi; \ + curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v${PWSH_VERSION}/powershell-${PWSH_VERSION}-linux-$DEBARCH.tar.gz \ + && mkdir -p /opt/microsoft/powershell/7 \ + && tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/7 \ + && chmod +x /opt/microsoft/powershell/7/pwsh \ + && ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh # Create non-root user and give them sudo access ARG USERNAME=deploydsh From a8401639e0b0f5d6eb425ad3101165499174509a Mon Sep 17 00:00:00 2001 From: Matt Craddock <5796417+craddm@users.noreply.github.com> Date: Mon, 30 Oct 2023 12:06:55 +0000 Subject: [PATCH 2/2] Update devcontainer json to newer style --- .devcontainer/devcontainer.json | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index eef8a11b29..7ecddb18f8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,13 +5,17 @@ "context": "..", "dockerfile": "Dockerfile" }, - "settings": { - "terminal.integrated.defaultProfile.linux": "bash" + "customizations": { + "vscode": { + "settings": { + "terminal.integrated.defaultProfile.linux": "bash" + }, + "extensions": [ + "github.vscode-pull-request-github", + "ms-vscode.powershell", + "ms-vscode.azure-account" + ] + } }, - "extensions": [ - "github.vscode-pull-request-github", - "ms-vscode.powershell", - "ms-vscode.azure-account" - ], "remoteUser": "deploydsh" }