Possible fix

Error: s6-overlay-suexec: fatal: can only run as pid 1
This commit is contained in:
Jørgen Ferdinand 2025-03-07 22:27:35 +01:00
parent ee7dd5da82
commit c8bb9cbb3f
2 changed files with 13 additions and 12 deletions

View file

@ -1,10 +1,9 @@
# Use the official Home Assistant add-on base image
FROM ghcr.io/hassio-addons/base:14.0.0 FROM ghcr.io/hassio-addons/base:14.0.0
# Install dependencies # Copy the script into the container
RUN apk add --no-cache docker-cli
# Copy the run script
COPY run.sh /run.sh COPY run.sh /run.sh
RUN chmod +x /run.sh RUN chmod +x /run.sh
CMD [ "/run.sh" ] # Run the script as the main process
CMD [ "/run.sh" ]

View file

@ -1,26 +1,26 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
echo "Starter Newt container..." echo "Starting Newt container..."
# Hent verdier fra Home Assistant config # Load config from Home Assistant options
PANGOLIN_ENDPOINT=$(bashio::config 'PANGOLIN_ENDPOINT') PANGOLIN_ENDPOINT=$(bashio::config 'PANGOLIN_ENDPOINT')
NEWT_ID=$(bashio::config 'NEWT_ID') NEWT_ID=$(bashio::config 'NEWT_ID')
NEWT_SECRET=$(bashio::config 'NEWT_SECRET') NEWT_SECRET=$(bashio::config 'NEWT_SECRET')
# Sjekk at Docker kjører # Ensure Docker is running
if ! docker info >/dev/null 2>&1; then if ! docker info >/dev/null 2>&1; then
echo "Docker er ikke tilgjengelig i Home Assistant OS!" echo "Docker is not available inside Home Assistant OS!"
exit 1 exit 1
fi fi
# Stopp og fjern gammel container hvis den finnes # Stop and remove any existing Newt container
if docker ps -a --format '{{.Names}}' | grep -q "newt"; then if docker ps -a --format '{{.Names}}' | grep -q "newt"; then
docker stop newt docker stop newt
docker rm newt docker rm newt
fi fi
# Kjør Newt-containeren # Run Newt container
docker run -d --restart unless-stopped \ docker run -d --restart unless-stopped \
--name newt \ --name newt \
-e PANGOLIN_ENDPOINT="$PANGOLIN_ENDPOINT" \ -e PANGOLIN_ENDPOINT="$PANGOLIN_ENDPOINT" \
@ -28,5 +28,7 @@ docker run -d --restart unless-stopped \
-e NEWT_SECRET="$NEWT_SECRET" \ -e NEWT_SECRET="$NEWT_SECRET" \
fosrl/newt fosrl/newt
echo "Newt-container kjører!" echo "Newt container is running!"
# Prevent the script from exiting (keeps the add-on running)
exec tail -f /dev/null exec tail -f /dev/null