mkdir ~/gitServer; cd ~/gitServerv
vi Dockerfile
---
FROM jdeathe/centos-ssh
RUN yum update -y
RUN yum install -y \
bzip2 \
git \
gcc \
perl-Archive-Tar \
perl-Encode \
perl-Scalar-List-Utils \
perl-PathTools \
perl-Text-Markdown \
perl-DBI \
perl-Time-HiRes \
perl-Sub-Identify \
perl-Digest-SHA \
perl-ExtUtils-MakeMaker \
; curl -L http://xrl.us/cpanm > /usr/bin/cpanm \
; chmod +x /usr/bin/cpanm \
; cpanm Archive::Tar \
Validator::Custom \
Params::Check \
Module::Load::Conditional \
Perl::OSType \
IPC::Cmd \
; cpanm Text::Markdown::Hoedown
RUN cd /opt ; git clone https://github.com/yuki-kimoto/gitprep.git gitprep \
; cd /opt/gitprep ; sh ./setup.sh \
; git config --global user.name "gitprep" \
; git config --global user.email "root@localhost"
ADD ./gitprep /etc/init.d/gitprep
RUN chmod +x /etc/init.d/gitprep \
; ln -s /etc/init.d/gitprep /etc/rc3.d/S99gitprep \
; ln -s /etc/init.d/gitprep /etc/rc3.d/K99gitprep \
; chkconfig --add /etc/init.d/gitprep \
; sed -i -e 's/^;on=1/on=1/' -e 's/^;path_depth=1/path_depth=1/' /opt/gitprep/gitprep.conf
EXPOSE 22 10020
ENTRYPOINT /etc/init.d/gitprep start \
; /etc/init.d/docker-registry start \
; /bin/bash
---
<blockquote>※gitの初期設定は適宜環境に合わせてください。</blockquote>
vi gitprep
---
#!/bin/sh
# chkconfig: 2345 99 10
# description: gitprep
prog="/opt/gitprep/gitprep"
case "$1" in
start)
$prog \
&& echo $prog started. \
&& exit 0
;;
stop)
$prog -s \
&& exit 0
;;
configtest|test|status)
$prog -t && exit 0
;;
reload|restart)
$prog -s \
&& $prog \
&& echo $prog started. \
&& exit 0
;;
*)
echo $"Usage: $0 {start|stop|reload|restart|configtest|status}"
exit 2
esac
---
sudo docker build -t gitServer .
sudo docker run -d \
-it \
--name gitServer \
gitServer \
/bin/bash