infra/codestorage/hg-ssh

Paddy 2015-08-17 Child:2f4a2a20ad6d

0:eeaf3e97ed44 Go to Latest

infra/codestorage/hg-ssh/Dockerfile

Initial commit. This hardcodes more than it should and syncs with Google Cloud Storage more than is really necessary, but it A) works and B) is currently on code.secondbit.org, so that should probably be recorded for posterity.

History
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Dockerfile	Mon Aug 17 19:07:28 2015 -0400
     1.3 @@ -0,0 +1,28 @@
     1.4 +FROM ubuntu:14.04
     1.5 +MAINTAINER Paddy Foran "<paddy@secondbit.org>"
     1.6 +
     1.7 +RUN groupadd -g 2000 committers
     1.8 +RUN mkdir -p /mounted/repos
     1.9 +RUN chown -R root:committers /mounted/repos
    1.10 +RUN chmod 0770 /mounted/repos
    1.11 +VOLUME /mounted
    1.12 +
    1.13 +ADD create_user.sh /usr/local/bin/helpers/create_user.sh
    1.14 +RUN chmod +x /usr/local/bin/helpers/create_user.sh
    1.15 +VOLUME /home
    1.16 +
    1.17 +RUN mkdir /var/run/sshd
    1.18 +
    1.19 +# install required packages
    1.20 +RUN apt-get -y update
    1.21 +RUN apt-get -y install openssh-server python-pip python-dev
    1.22 +RUN pip install Mercurial
    1.23 +
    1.24 +#ADD sshd_config /etc/ssh/sshd_config
    1.25 +RUN sed -ri 's/session    required     pam_loginuid.so/session    optional     pam_loginuid.so/g' /etc/pam.d/sshd
    1.26 +RUN sed -ri 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
    1.27 +RUN sed -ri 's/PermitRootLogin without-password/PermitRootLogin no/g' /etc/ssh/sshd_config
    1.28 +
    1.29 +EXPOSE 22
    1.30 +
    1.31 +CMD ["/usr/sbin/sshd", "-D"]