在Docker中部署Subversion 1.9.3(CentOS7)



1)启动Docker容器

docker run -it -p 40000:80 --name=apache centos7:7.2.1511 /bin/bash


安装依赖库

yum -y install gcc gcc-C++ make zlib-devel openssl-devel wget bzip2

2)安装apr 1.5.2 apr-util 1.5.4 apr-iconv 1.2.1

3)安装Apache-2.4.18


4)根据容器制作Apache镜像

docker commit apache centos7:apache-2.4.18


5)安装scons编译工具编译serf 1.3.8

wget http://prdownloads.sourceforge.net/scons/scons-2.4.1.tar.gz

python setup.py install

scons PREFIX=/usr/local/serf APR=/usr/local/apr APU=/usr/local/apr-util LIBDIR=/usr/lib64

ln -s /usr/local/serf/lib/libserf-1.a /usr/lib64/libserf-1.a
ln -s /usr/local/serf/lib/libserf-1.so /usr/lib64/libserf-1.so
ln -s /usr/local/serf/lib/libserf-1.so.1 /usr/lib64/libserf-1.so.1
ln -s /usr/local/serf/lib/libserf-1.so.1.3.0 /usr/lib64/libserf-1.so.1.3.0

6)安装Subversion 1.9.3
./configure --prefix=/usr/local/subversion \
--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util \
--with-serf=/usr/local/serf \
--with-apxs=/usr/local/apache2/bin/apxs --with-zlib \
--enable-mod-activation --enable-maintainer-mode

make && make install

7)验证安装
/usr/local/subversion/bin/svn --version

8)修改httpd.conf配置(参考以前版本配置)

9)部署在Docker中自动运行

docker run -it -v /opt/docker:/data -p 40002:80 --name=svn tanghao:svn-1.9.3 /bin/bash

docker exec svn apachectl


vi /etc/supervisor/supervisord.ini

[program:svn]
command=/usr/bin/docker restart svn
autostart=true

[program:svn-1.9.3]
command=/usr/bin/docker exec svn apachectl
autostart=true


10)访问

curl http://localhost/svn/projects




你可能感兴趣的:(在Docker中部署Subversion 1.9.3(CentOS7))