Signed-off-by: Jess Frazelle <jess@mesosphere.com>
This commit is contained in:
Jess Frazelle 2016-04-06 18:05:56 -07:00
parent 3dc19702e0
commit 2b0af26ae9
No known key found for this signature in database
GPG Key ID: 18F3685C0022BFF3
2 changed files with 14 additions and 7 deletions

View File

@ -22,19 +22,14 @@ RUN apk update && apk add \
&& adduser -D -S -s /usr/bin/git-shell -h /home/git -g git git \
&& mkdir -p /home/git/.ssh \
&& chown -R git:git /home/git \
&& passwd -u git \
&& { \
echo 'create_repo(){'; \
echo 'git init --bare $1'; \
echo 'chown -R git:git $1'; \
echo '}'; \
} > /etc/profile
&& passwd -u git
ENV HOME /home/git
EXPOSE 22
WORKDIR $HOME
COPY ./start.sh /
COPY create_repo /usr/bin/create_repo
ENTRYPOINT ["/start.sh"]
CMD ["/usr/sbin/sshd", "-D", "-e", "-f", "/etc/ssh/sshd_config"]

12
gitserver/create_repo Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
repo=$1
if [ $repo != *.git ]; then
repo="${repo}.git"
fi
echo "Creating $repo"
(
cd "$HOME"
git init --bare "$repo"
chown -R git:git "$repo"
)