diff --git a/Dockerfile b/Dockerfile index ca166ec..afe8116 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,9 +10,9 @@ FROM qemux/qemu-host as builder FROM debian:trixie-slim ARG TARGETPLATFORM -ARG DEBCONF_NOWARNINGS="yes" -ARG DEBIAN_FRONTEND noninteractive -ARG DEBCONF_NONINTERACTIVE_SEEN true +ARG DEBCONF_NOWARNINGS "yes" +ARG DEBIAN_FRONTEND "noninteractive" +ARG DEBCONF_NONINTERACTIVE_SEEN "true" RUN if [ "$TARGETPLATFORM" != "linux/amd64" ]; then extra="qemu-user"; fi \ && apt-get update \ @@ -52,7 +52,7 @@ ENV RAM_SIZE "1G" ENV DISK_SIZE "16G" ENV CPU_CORES "1" -ARG VERSION_ARG="0.0" +ARG VERSION_ARG "0.0" RUN echo "$VERSION_ARG" > /run/version HEALTHCHECK --interval=60s --start-period=45s --retries=2 CMD /run/check.sh diff --git a/src/reset.sh b/src/reset.sh index 319a7a2..0139845 100644 --- a/src/reset.sh +++ b/src/reset.sh @@ -44,6 +44,7 @@ if [ ! -d "/run/shm" ]; then fi # Cleanup files +rm -f /tmp/server.* rm -f /run/shm/qemu.* rm -f /run/shm/dsm.url diff --git a/src/server.sh b/src/server.sh index 995839a..e4a12fe 100644 --- a/src/server.sh +++ b/src/server.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -eu -TMP_FILE=$(mktemp -q /run/shm/server.XXXXXX) +TMP_FILE=$(mktemp -q /tmp/server.XXXXXX) stop() { trap - SIGINT EXIT @@ -35,9 +35,9 @@ if [[ "$2" != "/"* ]]; then socat TCP4-LISTEN:80,reuseaddr,fork,crlf SYSTEM:"cat $TMP_FILE" 2> /dev/null & socat TCP4-LISTEN:"${1:-5000}",reuseaddr,fork,crlf SYSTEM:"cat $TMP_FILE" 2> /dev/null & wait $! - + exit - + fi if [[ "$2" != "/run/ip.sh" ]]; then @@ -61,6 +61,6 @@ else fi chmod +x "$TMP_FILE" - + socat TCP4-LISTEN:80,reuseaddr,fork,crlf SYSTEM:"$TMP_FILE" 2> /dev/null & socat TCP4-LISTEN:"${1:-5000}",reuseaddr,fork,crlf SYSTEM:"$TMP_FILE" 2> /dev/null & wait $!