standardize apt-get, rebase to 3.14

This commit is contained in:
aptalca 2021-09-21 14:20:27 -04:00
parent 194b1c7b85
commit dc75c53b1d
3 changed files with 27 additions and 24 deletions

View File

@ -1,5 +1,5 @@
## Buildstage ##
FROM ghcr.io/linuxserver/baseimage-alpine:3.12 as buildstage
FROM ghcr.io/linuxserver/baseimage-alpine:3.14 as buildstage
# Build arguments
ARG VERSION

View File

@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bash
if [ -f /usr/bin/apt ]; then
apt-get update
fi

View File

@ -13,37 +13,35 @@ EOF
# Determine if setup is needed
if [ ! -f /usr/bin/mkvmerge ]; then
echo "Running first time setup."
echo "Running first time setup."
if [ -f /usr/bin/apt ]; then
# Ubuntu
echo "Installing MKVToolNix using apt-get"
apt-get update && \
apt-get -y install mkvtoolnix && \
rm -rf /var/lib/apt/lists/*
elif [ -f /sbin/apk ]; then
# Alpine
echo "Installing MKVToolNix using apk"
apk add --no-cache mkvtoolnix && \
rm -rf /var/lib/apt/lists/*
else
# Unknown
echo "Unknown package manager. Attempting to install MKVToolNix using apt-get"
apt-get update && \
apt-get -y install mkvtoolnix && \
rm -rf /var/lib/apt/lists/*
fi
if [ -f /usr/bin/apt ]; then
# Ubuntu
echo "Installing MKVToolNix using apt-get"
apt-get -y install mkvtoolnix && \
rm -rf /var/lib/apt/lists/*
elif [ -f /sbin/apk ]; then
# Alpine
echo "Installing MKVToolNix using apk"
apk add --no-cache mkvtoolnix && \
rm -rf /var/lib/apt/lists/*
else
# Unknown
echo "Unknown package manager. Attempting to install MKVToolNix using apt-get"
apt-get -y install mkvtoolnix && \
rm -rf /var/lib/apt/lists/*
fi
fi
# Change ownership
if [ $(stat -c '%G' /usr/local/bin/striptracks.sh) != "abc" ]; then
echo "Changing ownership on scripts."
chown abc:abc /usr/local/bin/striptracks*.sh
echo "Changing ownership on scripts."
chown abc:abc /usr/local/bin/striptracks*.sh
fi
# Make executable
if [ ! -x /usr/local/bin/striptracks.sh ]; then
echo "Making scripts executable."
chmod +x /usr/local/bin/striptracks*.sh
echo "Making scripts executable."
chmod +x /usr/local/bin/striptracks*.sh
fi