fix: unix user perms
Build and Publish Container / Publish Linux container (push) Successful in 5m32s
Build and Publish Container / Publish Linux container (push) Successful in 5m32s
This commit is contained in:
+2
-4
@@ -4,7 +4,7 @@ ARG DEBIAN_FRONTEND=noninteractive
|
|||||||
RUN dpkg --add-architecture i386 \
|
RUN dpkg --add-architecture i386 \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
ca-certificates curl gosu lib32gcc-s1 python3 python3-pip python3-venv \
|
ca-certificates curl lib32gcc-s1 python3 python3-pip python3-venv \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& useradd --create-home --shell /bin/bash progression \
|
&& useradd --create-home --shell /bin/bash progression \
|
||||||
&& mkdir -p /opt/steamcmd/steamapps /srv/progression/.data \
|
&& mkdir -p /opt/steamcmd/steamapps /srv/progression/.data \
|
||||||
@@ -21,9 +21,7 @@ COPY --chown=progression:progression progression_backend ./progression_backend
|
|||||||
COPY --chown=progression:progression art ./art
|
COPY --chown=progression:progression art ./art
|
||||||
COPY --chmod=755 docker-entrypoint.sh /usr/local/bin/progression-entrypoint
|
COPY --chmod=755 docker-entrypoint.sh /usr/local/bin/progression-entrypoint
|
||||||
|
|
||||||
ENV HOME=/home/progression \
|
ENV HOME=/root \
|
||||||
USER=progression \
|
|
||||||
XDG_DATA_HOME=/home/progression/.local/share \
|
|
||||||
PROGRESSION_HOST=0.0.0.0 \
|
PROGRESSION_HOST=0.0.0.0 \
|
||||||
PROGRESSION_PORT=8000 \
|
PROGRESSION_PORT=8000 \
|
||||||
PROGRESSION_DB_PATH=.data/progression.db \
|
PROGRESSION_DB_PATH=.data/progression.db \
|
||||||
|
|||||||
@@ -22,3 +22,7 @@ result, and completion percentage in Dockhand or with `docker compose logs -f`.
|
|||||||
Failed batches also include SteamCMD's output tail so network, subscription, and
|
Failed batches also include SteamCMD's output tail so network, subscription, and
|
||||||
filesystem errors are visible directly in the container log.
|
filesystem errors are visible directly in the container log.
|
||||||
|
|
||||||
|
The image does not switch Unix users at startup because some rootless and
|
||||||
|
capability-restricted container hosts block `setuid`. The process remains inside
|
||||||
|
the container's user namespace and writes directly to its named volumes.
|
||||||
|
|
||||||
|
|||||||
@@ -3,17 +3,16 @@ set -eu
|
|||||||
|
|
||||||
prepare_volume() {
|
prepare_volume() {
|
||||||
path="$1"
|
path="$1"
|
||||||
marker="$path/.progression-volume-ready"
|
marker="$path/.progression-root-volume-ready"
|
||||||
mkdir -p "$path"
|
mkdir -p "$path"
|
||||||
if [ ! -e "$marker" ]; then
|
if [ ! -e "$marker" ]; then
|
||||||
echo "Preparing persistent volume permissions: $path"
|
echo "Preparing persistent volume for the container user: $path"
|
||||||
chown -R progression:progression "$path"
|
chown -R 0:0 "$path"
|
||||||
touch "$marker"
|
touch "$marker"
|
||||||
chown progression:progression "$marker"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
prepare_volume /srv/progression/.data
|
prepare_volume /srv/progression/.data
|
||||||
prepare_volume /opt/steamcmd/steamapps
|
prepare_volume /opt/steamcmd/steamapps
|
||||||
|
|
||||||
exec gosu progression "$@"
|
exec "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user