Browse Source

Work around the chroot dir having to be root owned

master
Carlos Mogas da Silva 8 months ago
parent
commit
9a5d1f9c32
  1. 2
      Dockerfile
  2. 2
      entrypoint.sh

2
Dockerfile

@ -8,7 +8,7 @@ RUN apt update \
RUN rm -f /etc/ssh/ssh_host_* \
&& groupadd --non-unique --gid $GROUPID data \
&& useradd --non-unique --uid $USERID --gid $GROUPID --no-create-home --home-dir /home/data data \
&& useradd --non-unique --uid $USERID --gid $GROUPID --no-create-home --home-dir /home data \
&& mkdir -p /home/data \
&& chown root:root /home/data \
&& mkdir -p /etc/ssh/host_keys/ \

2
entrypoint.sh

@ -11,7 +11,7 @@ echo "$AUTHORIZED_KEYS" > $AUTHORIZED_KEYS_FILE
groupmod --non-unique --gid "$GROUPID" data
usermod --non-unique --uid "$USERID" --gid "$GROUPID" data
# Chown data folder (if mounted as a volume for the first time)
chown -R "${USERID}:${GROUPID}" "/home/data/*"
chown -R "${USERID}:${GROUPID}" "/home/data"
chown "${USERID}:${GROUPID}" $AUTHORIZED_KEYS_FILE
# Run sshd on container start

Loading…
Cancel
Save