mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-19 01:46:10 -04:00
standardize apt-get
This commit is contained in:
+13
-13
@@ -1,30 +1,30 @@
|
|||||||
FROM lsiobase/alpine:3.11 as buildstage
|
FROM ghcr.io/linuxserver/baseimage-alpine:3.13 as buildstage
|
||||||
|
|
||||||
ARG PS_VERSION
|
ARG PS_VERSION
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
curl \
|
curl \
|
||||||
jq && \
|
jq && \
|
||||||
if [ -z ${PS_VERSION+x} ]; then \
|
if [ -z ${PS_VERSION+x} ]; then \
|
||||||
PS_VERSION=$(curl -sX GET "https://api.github.com/repos/PowerShell/PowerShell/releases/latest" \
|
PS_VERSION=$(curl -sX GET "https://api.github.com/repos/PowerShell/PowerShell/releases/latest" \
|
||||||
| jq -r .tag_name | awk '{print substr($1,2); }'); \
|
| jq -r .tag_name | awk '{print substr($1,2); }'); \
|
||||||
fi && \
|
fi && \
|
||||||
mkdir -p /root-layer/powershell && \
|
mkdir -p /root-layer/powershell && \
|
||||||
curl -o \
|
curl -o \
|
||||||
/root-layer/powershell/powershell_x86_64.tar.gz -L \
|
/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" && \
|
"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 \
|
/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" && \
|
"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 \
|
/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" && \
|
"https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/powershell-${PS_VERSION}-linux-arm64.tar.gz" && \
|
||||||
echo "******** run basic test to validate tarballs *********" && \
|
echo "******** run basic test to validate tarballs *********" && \
|
||||||
for i in x86_64 armv7l aarch64; do \
|
for i in x86_64 armv7l aarch64; do \
|
||||||
mkdir -p "/tmp/${i}"; \
|
mkdir -p "/tmp/${i}"; \
|
||||||
tar xzf "/root-layer/powershell/powershell_${i}.tar.gz" -C "/tmp/${i}"; \
|
tar xzf "/root-layer/powershell/powershell_${i}.tar.gz" -C "/tmp/${i}"; \
|
||||||
done
|
done
|
||||||
|
|
||||||
COPY root/ /root-layer/
|
COPY root/ /root-layer/
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
|
apt-get update
|
||||||
@@ -3,17 +3,16 @@
|
|||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
|
|
||||||
if [ -f "/powershell/powershell_${ARCH}.tar.gz" ]; then
|
if [ -f "/powershell/powershell_${ARCH}.tar.gz" ]; then
|
||||||
echo "Installing PowerShell"
|
echo "Installing PowerShell"
|
||||||
apt-get update
|
apt-get install -y \
|
||||||
apt-get install -y \
|
libicu60 \
|
||||||
libicu60 \
|
libunwind8
|
||||||
libunwind8
|
tar xf "/powershell/powershell_${ARCH}.tar.gz" -C /powershell
|
||||||
tar xf "/powershell/powershell_${ARCH}.tar.gz" -C /powershell
|
rm -rf \
|
||||||
rm -rf \
|
/powershell/powershell_x86_64.tar.gz \
|
||||||
/powershell/powershell_x86_64.tar.gz \
|
/powershell/powershell_armv7l.tar.gz \
|
||||||
/powershell/powershell_armv7l.tar.gz \
|
/powershell/powershell_aarch64.tar.gz
|
||||||
/powershell/powershell_aarch64.tar.gz
|
ln -s /powershell/pwsh /usr/bin/pwsh
|
||||||
ln -s /powershell/pwsh /usr/bin/pwsh
|
|
||||||
else
|
else
|
||||||
echo "PowerShell already installed, skipping"
|
echo "PowerShell already installed, skipping"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user