Merge pull request #130 from linuxserver/jammy-legacy-scripts
Remove legacy scripts checkpull/133/head jammy-77bf89e6-ls55
commit
e1a12b4732
|
@ -1,6 +1,6 @@
|
||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
FROM alpine:3.15 as rootfs-stage
|
FROM alpine:3.17 as rootfs-stage
|
||||||
|
|
||||||
# environment
|
# environment
|
||||||
ENV REL=jammy
|
ENV REL=jammy
|
||||||
|
@ -11,7 +11,6 @@ RUN \
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
bash \
|
bash \
|
||||||
curl \
|
curl \
|
||||||
tar \
|
|
||||||
tzdata \
|
tzdata \
|
||||||
xz
|
xz
|
||||||
|
|
||||||
|
@ -23,7 +22,9 @@ RUN \
|
||||||
https://partner-images.canonical.com/core/${REL}/current/ubuntu-${REL}-core-cloudimg-${ARCH}-root.tar.gz && \
|
https://partner-images.canonical.com/core/${REL}/current/ubuntu-${REL}-core-cloudimg-${ARCH}-root.tar.gz && \
|
||||||
tar xf \
|
tar xf \
|
||||||
/rootfs.tar.gz -C \
|
/rootfs.tar.gz -C \
|
||||||
/root-out
|
/root-out && \
|
||||||
|
rm -rf \
|
||||||
|
/root-out/var/log/*
|
||||||
|
|
||||||
# set version for s6 overlay
|
# set version for s6 overlay
|
||||||
ARG S6_OVERLAY_VERSION="3.1.2.1"
|
ARG S6_OVERLAY_VERSION="3.1.2.1"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
FROM alpine:3.15 as rootfs-stage
|
FROM alpine:3.17 as rootfs-stage
|
||||||
|
|
||||||
# environment
|
# environment
|
||||||
ENV REL=jammy
|
ENV REL=jammy
|
||||||
|
@ -11,7 +11,6 @@ RUN \
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
bash \
|
bash \
|
||||||
curl \
|
curl \
|
||||||
tar \
|
|
||||||
tzdata \
|
tzdata \
|
||||||
xz
|
xz
|
||||||
|
|
||||||
|
@ -23,7 +22,9 @@ RUN \
|
||||||
https://partner-images.canonical.com/core/${REL}/current/ubuntu-${REL}-core-cloudimg-${ARCH}-root.tar.gz && \
|
https://partner-images.canonical.com/core/${REL}/current/ubuntu-${REL}-core-cloudimg-${ARCH}-root.tar.gz && \
|
||||||
tar xf \
|
tar xf \
|
||||||
/rootfs.tar.gz -C \
|
/rootfs.tar.gz -C \
|
||||||
/root-out
|
/root-out && \
|
||||||
|
rm -rf \
|
||||||
|
/root-out/var/log/*
|
||||||
|
|
||||||
# set version for s6 overlay
|
# set version for s6 overlay
|
||||||
ARG S6_OVERLAY_VERSION="3.1.2.1"
|
ARG S6_OVERLAY_VERSION="3.1.2.1"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
FROM alpine:3.15 as rootfs-stage
|
FROM alpine:3.17 as rootfs-stage
|
||||||
|
|
||||||
# environment
|
# environment
|
||||||
ENV REL=jammy
|
ENV REL=jammy
|
||||||
|
@ -11,7 +11,6 @@ RUN \
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
bash \
|
bash \
|
||||||
curl \
|
curl \
|
||||||
tar \
|
|
||||||
tzdata \
|
tzdata \
|
||||||
xz
|
xz
|
||||||
|
|
||||||
|
@ -23,7 +22,9 @@ RUN \
|
||||||
https://partner-images.canonical.com/core/${REL}/current/ubuntu-${REL}-core-cloudimg-${ARCH}-root.tar.gz && \
|
https://partner-images.canonical.com/core/${REL}/current/ubuntu-${REL}-core-cloudimg-${ARCH}-root.tar.gz && \
|
||||||
tar xf \
|
tar xf \
|
||||||
/rootfs.tar.gz -C \
|
/rootfs.tar.gz -C \
|
||||||
/root-out
|
/root-out && \
|
||||||
|
rm -rf \
|
||||||
|
/root-out/var/log/*
|
||||||
|
|
||||||
# set version for s6 overlay
|
# set version for s6 overlay
|
||||||
ARG S6_OVERLAY_VERSION="3.1.2.1"
|
ARG S6_OVERLAY_VERSION="3.1.2.1"
|
||||||
|
|
|
@ -2,21 +2,8 @@
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
# Directories
|
# Directories
|
||||||
SCRIPTS_DIR_OLD="/config/custom-cont-init.d"
|
|
||||||
SCRIPTS_DIR="/custom-cont-init.d"
|
SCRIPTS_DIR="/custom-cont-init.d"
|
||||||
|
|
||||||
SERVICES_DIR_OLD="/config/custom-services.d"
|
|
||||||
|
|
||||||
# chown legacy folders if they exist
|
|
||||||
if [[ -e "${SCRIPTS_DIR_OLD}" ]]; then
|
|
||||||
chown -R 0:0 "${SCRIPTS_DIR_OLD}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# chown legacy folders if they exist
|
|
||||||
if [[ -e "${SERVICES_DIR_OLD}" ]]; then
|
|
||||||
chown -R 0:0 "${SERVICES_DIR_OLD}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make sure custom init directory exists and has files in it
|
# Make sure custom init directory exists and has files in it
|
||||||
if [[ -e "${SCRIPTS_DIR}" ]] && [[ -n "$(/bin/ls -A ${SCRIPTS_DIR} 2>/dev/null)" ]]; then
|
if [[ -e "${SCRIPTS_DIR}" ]] && [[ -n "$(/bin/ls -A ${SCRIPTS_DIR} 2>/dev/null)" ]]; then
|
||||||
echo "[custom-init] Files found, executing"
|
echo "[custom-init] Files found, executing"
|
||||||
|
@ -30,27 +17,6 @@ if [[ -e "${SCRIPTS_DIR}" ]] && [[ -n "$(/bin/ls -A ${SCRIPTS_DIR} 2>/dev/null)"
|
||||||
echo "[custom-init] ${NAME}: is not a file"
|
echo "[custom-init] ${NAME}: is not a file"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Remove legacy folder if it's empty
|
|
||||||
if [[ -e "${SCRIPTS_DIR_OLD}" ]] && [[ -z "$(/bin/ls -A ${SCRIPTS_DIR_OLD} 2>/dev/null)" ]]; then
|
|
||||||
echo "[custom-init] Legacy files folder ${SCRIPTS_DIR_OLD} is empty, deleting..."
|
|
||||||
rm -rf "${SCRIPTS_DIR_OLD}"
|
|
||||||
fi
|
|
||||||
elif [[ -e "${SCRIPTS_DIR_OLD}" ]] && [[ -n "$(/bin/ls -A ${SCRIPTS_DIR_OLD} 2>/dev/null)" ]]; then
|
|
||||||
echo "[custom-init] Files found, executing"
|
|
||||||
for SCRIPT in "${SCRIPTS_DIR_OLD}"/*; do
|
|
||||||
NAME="$(basename "${SCRIPT}")"
|
|
||||||
if [[ -f "${SCRIPT}" ]]; then
|
|
||||||
echo "[custom-init] ${NAME}: executing..."
|
|
||||||
/bin/bash "${SCRIPT}"
|
|
||||||
echo "[custom-init] ${NAME}: exited $?"
|
|
||||||
elif [[ ! -f "${SCRIPT}" ]]; then
|
|
||||||
echo "[custom-init] ${NAME}: is not a file"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
elif [[ -e "${SCRIPTS_DIR_OLD}" ]] && [[ -z "$(/bin/ls -A ${SCRIPTS_DIR_OLD} 2>/dev/null)" ]]; then
|
|
||||||
echo "[custom-init] Legacy files folder ${SCRIPTS_DIR_OLD} is empty, deleting..."
|
|
||||||
rm -rf "${SCRIPTS_DIR_OLD}"
|
|
||||||
else
|
else
|
||||||
echo "[custom-init] No custom files found, skipping..."
|
echo "[custom-init] No custom files found, skipping..."
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
#!/usr/bin/with-contenv bash
|
|
||||||
# shellcheck shell=bash
|
|
||||||
|
|
||||||
if [[ -n "$(/bin/ls -A "/config/custom-cont-init.d" 2>/dev/null)" ]] ||
|
|
||||||
[[ -n "$(/bin/ls -A "/config/custom-services.d" 2>/dev/null)" ]]; then
|
|
||||||
cat << EOF | tee /config/custom-cont-init.d/README.txt 2>/dev/null
|
|
||||||
********************************************************
|
|
||||||
********************************************************
|
|
||||||
* *
|
|
||||||
* !!!! *
|
|
||||||
* Custom scripts or services found in legacy locations *
|
|
||||||
* !!!! *
|
|
||||||
* Please move your custom scripts and services *
|
|
||||||
* to /custom-cont-init.d and /custom-services.d *
|
|
||||||
* respectively to ensure they continue working. *
|
|
||||||
* *
|
|
||||||
* Visit https://linuxserver.io/custom for more info. *
|
|
||||||
* *
|
|
||||||
********************************************************
|
|
||||||
********************************************************
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
exit 0
|
|
|
@ -1 +0,0 @@
|
||||||
oneshot
|
|
|
@ -1 +0,0 @@
|
||||||
/etc/s6-overlay/s6-rc.d/init-script-check/run
|
|
Ładowanie…
Reference in New Issue