Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update devcontainer configuration #1662

Merged
merged 4 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 36 additions & 21 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 11 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Loading