2015-11-24 18:35:51 +00:00
|
|
|
FROM cloudron/base:0.8.0
|
2015-04-26 19:45:32 +00:00
|
|
|
|
2015-04-29 02:29:12 +00:00
|
|
|
RUN apt-get update && \
|
2015-08-17 19:09:42 +00:00
|
|
|
apt-get install -y openssh-server && \
|
2015-04-29 02:29:12 +00:00
|
|
|
rm -r /var/cache/apt /var/lib/apt/lists
|
2015-04-29 00:12:16 +00:00
|
|
|
|
2015-04-29 02:29:12 +00:00
|
|
|
ADD supervisor/ /etc/supervisor/conf.d/
|
2015-04-29 00:12:16 +00:00
|
|
|
|
2016-02-22 02:52:08 +00:00
|
|
|
RUN adduser --disabled-login --gecos 'Gogs' git
|
|
|
|
# by default, git account is created as inactive which prevents login via openssh
|
|
|
|
# https://github.com/gitlabhq/gitlabhq/issues/5304
|
|
|
|
RUN passwd -d git
|
|
|
|
|
|
|
|
RUN mkdir -p /home/git/gogs
|
2015-06-24 21:26:43 +00:00
|
|
|
## TODO: use redis as well
|
2016-02-22 02:52:08 +00:00
|
|
|
RUN cd /home/git/gogs && \
|
2016-03-23 16:11:34 +00:00
|
|
|
curl -L https://github.com/gogits/gogs/releases/download/v0.9.13/linux_amd64.tar.gz | tar zxvf - --strip-components 1
|
2015-04-26 19:45:32 +00:00
|
|
|
|
2015-10-13 22:27:09 +00:00
|
|
|
# setup config paths
|
2016-02-22 02:52:08 +00:00
|
|
|
ADD app.ini.template /home/git/app.ini.template
|
|
|
|
RUN mkdir -p /run/gogs && chown -R git:git /run/gogs
|
2015-10-13 22:27:09 +00:00
|
|
|
|
|
|
|
# setup log paths
|
2016-02-22 02:52:08 +00:00
|
|
|
RUN mkdir -p /run/gogs && chown -R git:git /run/gogs
|
2015-11-24 18:52:20 +00:00
|
|
|
RUN sed -e 's,^logfile=.*$,logfile=/run/gogs/supervisord.log,' -i /etc/supervisor/supervisord.conf
|
2015-10-13 22:27:09 +00:00
|
|
|
|
2016-02-22 02:52:08 +00:00
|
|
|
RUN ln -s /app/data/ssh /home/git/.ssh
|
|
|
|
RUN ln -s /app/data/gitconfig /home/git/.gitconfig
|
2015-10-13 23:12:06 +00:00
|
|
|
|
2016-02-22 02:52:08 +00:00
|
|
|
ADD start.sh /home/git/start.sh
|
2015-04-26 19:45:32 +00:00
|
|
|
|
2015-04-29 02:29:12 +00:00
|
|
|
# disable pam authentication for sshd
|
2015-11-24 18:52:20 +00:00
|
|
|
RUN sed -e 's/UsePAM yes/UsePAM no/' -e 's/UsePrivilegeSeparation yes/UsePrivilegeSeparation no/' -i /etc/ssh/sshd_config
|
2015-04-29 02:29:12 +00:00
|
|
|
RUN echo "UseDNS no" >> /etc/ssh/sshd_config
|
|
|
|
|
2016-02-22 02:52:08 +00:00
|
|
|
CMD [ "/home/git/start.sh" ]
|
2015-04-26 19:45:32 +00:00
|
|
|
|