mirror of
https://github.com/linuxserver/docker-mods.git
synced 2026-03-23 00:05:28 +08:00
Merge pull request #220 from linuxserver/code-server-powershell-apt
standardize apt-get
This commit is contained in:
commit
6c15920d13
26
Dockerfile
26
Dockerfile
@ -1,30 +1,30 @@
|
||||
FROM lsiobase/alpine:3.11 as buildstage
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:3.13 as buildstage
|
||||
|
||||
ARG PS_VERSION
|
||||
|
||||
RUN \
|
||||
apk add --no-cache \
|
||||
apk add --no-cache \
|
||||
curl \
|
||||
jq && \
|
||||
if [ -z ${PS_VERSION+x} ]; then \
|
||||
PS_VERSION=$(curl -sX GET "https://api.github.com/repos/PowerShell/PowerShell/releases/latest" \
|
||||
| jq -r .tag_name | awk '{print substr($1,2); }'); \
|
||||
fi && \
|
||||
mkdir -p /root-layer/powershell && \
|
||||
curl -o \
|
||||
if [ -z ${PS_VERSION+x} ]; then \
|
||||
PS_VERSION=$(curl -sX GET "https://api.github.com/repos/PowerShell/PowerShell/releases/latest" \
|
||||
| jq -r .tag_name | awk '{print substr($1,2); }'); \
|
||||
fi && \
|
||||
mkdir -p /root-layer/powershell && \
|
||||
curl -o \
|
||||
/root-layer/powershell/powershell_x86_64.tar.gz -L \
|
||||
"https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/powershell-${PS_VERSION}-linux-x64.tar.gz" && \
|
||||
curl -o \
|
||||
curl -o \
|
||||
/root-layer/powershell/powershell_armv7l.tar.gz -L \
|
||||
"https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/powershell-${PS_VERSION}-linux-arm32.tar.gz" && \
|
||||
curl -o \
|
||||
curl -o \
|
||||
/root-layer/powershell/powershell_aarch64.tar.gz -L \
|
||||
"https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/powershell-${PS_VERSION}-linux-arm64.tar.gz" && \
|
||||
echo "******** run basic test to validate tarballs *********" && \
|
||||
for i in x86_64 armv7l aarch64; do \
|
||||
echo "******** run basic test to validate tarballs *********" && \
|
||||
for i in x86_64 armv7l aarch64; do \
|
||||
mkdir -p "/tmp/${i}"; \
|
||||
tar xzf "/root-layer/powershell/powershell_${i}.tar.gz" -C "/tmp/${i}"; \
|
||||
done
|
||||
done
|
||||
|
||||
COPY root/ /root-layer/
|
||||
|
||||
|
||||
3
root/etc/cont-init.d/95-apt-get
Normal file
3
root/etc/cont-init.d/95-apt-get
Normal file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
apt-get update
|
||||
@ -3,17 +3,16 @@
|
||||
ARCH=$(uname -m)
|
||||
|
||||
if [ -f "/powershell/powershell_${ARCH}.tar.gz" ]; then
|
||||
echo "Installing PowerShell"
|
||||
apt-get update
|
||||
apt-get install -y \
|
||||
libicu60 \
|
||||
libunwind8
|
||||
tar xf "/powershell/powershell_${ARCH}.tar.gz" -C /powershell
|
||||
rm -rf \
|
||||
/powershell/powershell_x86_64.tar.gz \
|
||||
/powershell/powershell_armv7l.tar.gz \
|
||||
/powershell/powershell_aarch64.tar.gz
|
||||
ln -s /powershell/pwsh /usr/bin/pwsh
|
||||
echo "Installing PowerShell"
|
||||
apt-get install -y \
|
||||
libicu60 \
|
||||
libunwind8
|
||||
tar xf "/powershell/powershell_${ARCH}.tar.gz" -C /powershell
|
||||
rm -rf \
|
||||
/powershell/powershell_x86_64.tar.gz \
|
||||
/powershell/powershell_armv7l.tar.gz \
|
||||
/powershell/powershell_aarch64.tar.gz
|
||||
ln -s /powershell/pwsh /usr/bin/pwsh
|
||||
else
|
||||
echo "PowerShell already installed, skipping"
|
||||
echo "PowerShell already installed, skipping"
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user