Merge pull request #1 from ambroisemaupate/master

Custom UID and restartable container
This commit is contained in:
Knut Ahlers 2015-07-04 00:09:35 +02:00
commit f5142c82d6
2 changed files with 6 additions and 6 deletions

View file

@ -3,6 +3,7 @@ MAINTAINER Knut Ahlers <knut@ahlers.me>
ENV USER share
ENV PASS changeme
ENV USER_UID 1000
RUN apt-get update && \
apt-get install -y openssh-server mcrypt && \

View file

@ -1,12 +1,11 @@
#!/bin/bash
ENC_PASS=$(perl -e 'print crypt($ARGV[0], "password")' ${PASS})
if ( id ${USER} ); then
echo "FATAL: User ${USER} already exists"
exit 1
echo "INFO: User ${USER} already exists"
else
echo "INFO: User ${USER} does not exists, we create it"
ENC_PASS=$(perl -e 'print crypt($ARGV[0], "password")' ${PASS})
useradd -d /data -m -p ${ENC_PASS} -u ${USER_UID} -s /bin/sh ${USER}
fi
useradd -d /data -m -p ${ENC_PASS} -u 1000 -s /bin/sh ${USER}
exec /usr/sbin/sshd -D