[SVN] Use Docker to build SVN server

1. Download the image and configure the mapping directory

  • Execute the following commands to pull the image and mount the configuration
docker run \
	--name my-svn-server \
	--detach \
	--volume /home/data/svn:/var/opt/svn \
	--publish 3690:3690 \
	garethflowers/svn-server

Insert image description here

2. Create a new SVN repository

  • Use svnadmin within your container to create and manage repositories.
  • For example, to create a repository named new-repo container my-svn-server, use the following command:
docker exec -it my-svn-server svnadmin create new-repo
  • After the creation is completed, it will look like this:
    Insert image description here

3.Permission adjustment

  • Modify the svnserve.conf file
[general]
anon-access = read             # 匿名用户不可读写,也可设置为只读 read
auth-access = write            # 授权用户可写
password-db = passwd           # 密码文件路径,相对于当前目录
authz-db = authz               # 访问控制文件
realm = /var/opt/svn/huiyeai-repo  # 该地址必须为容器内的地址否则无效
  • Modify passwd file
[users]
# harry = harryssecret
# sally = sallyssecret
admin = adminhuiyeai123
  • Modify authz file
[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
owner = admin
[/]
[huiyeai-repo:/]
admin = rw
@owner = rw

4. File access

  • Download the svn tool for testing and log in with the admin user to complete.
svn co svn://127.0.0.1:3690/my_repos_name

Guess you like

Origin blog.csdn.net/h609232722/article/details/128985592