File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 9
9
PS_VERSION=$(curl -sX GET "https://api.github.com/repos/PowerShell/PowerShell/releases/latest" \
10
10
| awk '/tag_name/{print $4;exit}' FS='[""]' | awk '{print substr($1,2); }' ); \
11
11
fi && \
12
- mkdir -p /root-layer && \
12
+ mkdir -p /root-layer/powershell && \
13
13
curl -o \
14
- /root-layer/powershell.deb -L \
15
- "https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/powershell_${PS_VERSION}-1.ubuntu.18.04_amd64.deb"
14
+ /root-layer/powershell/powershell_x86_64.tar.gz -L \
15
+ "https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/powershell_${PS_VERSION}-linux-x64.tar.gz" && \
16
+ curl -o \
17
+ /root-layer/powershell/powershell_armv7l.tar.gz -L \
18
+ "https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/powershell_${PS_VERSION}-linux-arm32.tar.gz" && \
19
+ curl -o \
20
+ /root-layer/powershell/powershell_aarch64.tar.gz -L \
21
+ "https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/powershell_${PS_VERSION}-linux-arm64.tar.gz"
16
22
17
23
COPY root/ /root-layer/
18
24
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/with-contenv bash
2
2
3
- if [ -f "/powershell.deb" ]; then
3
+ ARCH=$(uname -m)
4
+
5
+ if [ -f "/powershell/powershell_${ARCH}.tar.gz" ]; then
4
6
echo "Installing PowerShell"
5
7
apt-get update
6
- apt-get install -y /powershell.deb
7
- rm /powershell.deb
8
+ apt-get install -y \
9
+ libicu60 \
10
+ libunwind8
11
+ tar xf "/powershell/powershell_${ARCH}.tar.gz" -C /powershell
12
+ rm -rf \
13
+ /powershell/powershell_x86_64.tar.gz \
14
+ /powershell/powershell_armv7l.tar.gz \
15
+ /powershell/powershell_aarch64.tar.gz
16
+ ln -s /powershell/pwsh /usr/bin/pwsh
8
17
else
9
18
echo "PowerShell already installed, skipping"
10
19
fi
You can’t perform that action at this time.
0 commit comments