Install Powershell on Alpine 3.19 (#1100)

Co-authored-by: Matt Mitchell (.NET) <mmitche@microsoft.com>
This commit is contained in:
William Godbe 2024-06-26 12:24:31 -07:00 коммит произвёл GitHub
Родитель d7a6291938
Коммит 437491db0f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 29 добавлений и 0 удалений

Просмотреть файл

@ -6,6 +6,7 @@ RUN apk update && apk add --no-cache \
automake \
bash \
build-base \
ca-certificates \
clang \
clang-dev \
cmake \
@ -18,9 +19,16 @@ RUN apk update && apk add --no-cache \
git \
icu-data-full \
icu-dev \
icu-libs \
jq \
krb5-dev \
krb5-libs \
libtool \
less \
libgcc \
libintl \
libssl3 \
libstdc++ \
libunwind-dev \
linux-headers \
lld \
@ -28,6 +36,7 @@ RUN apk update && apk add --no-cache \
llvm \
lttng-ust-dev \
make \
ncurses-terminfo-base \
numactl-dev \
openssl \
openssl-dev \
@ -37,6 +46,26 @@ RUN apk update && apk add --no-cache \
shadow \
sudo \
tzdata \
userspace-rcu \
util-linux-dev \
which \
zlib-dev
# Install the latest non-preview powershell release.
RUN apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache lttng-ust \
&& LATEST_TAG=$(curl -L https://api.github.com/repos/powershell/powershell/releases/latest | jq -r '.tag_name') \
# Verify that it's a 7.x release
&& [[ $LATEST_TAG == v7.* ]] \
&& curl -L https://github.com/PowerShell/PowerShell/releases/download/$LATEST_TAG/powershell-${LATEST_TAG#*v}-linux-musl-x64.tar.gz -o /tmp/powershell.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 \
&& rm -f /tmp/powershell.tar.gz
# Install azurecli from PIP
RUN azureEnv="/usr/local/share/azure-cli-env" && \
python3 -m venv "$azureEnv" && \
"$azureEnv/bin/python" -m pip install --upgrade setuptools && \
"$azureEnv/bin/python" -m pip install azure-cli && \
ln -s "$azureEnv/bin/az" /usr/local/bin/az