【实战Docker】SVN服务

2019.06.05
----------------------------------------------------------------------------------
docker pull harbor.ratp.com/library/garethflowers/svn-server:1.2.2

----------------------------------------------------------------------------------
datadev@data-dev ~/xxxx/docker2019/docker-fileserv/svn-server$ docker pull harbor.ratp.com/library/garethflowers/svn-server:1.2.2
WARNING: Error loading config file:/home/datadev/.docker/config.json - stat /home/datadev/.docker/config.json: permission denied
1.2.2: Pulling from library/garethflowers/svn-server
bdf0201b3a05: Pull complete 
4bae6ca1e4a0: Pull complete 
c13ab2789d28: Pull complete 
Digest: sha256:62cdd515b2bbdbd9f8ff2a0d0e3e1294cfdf80b2b39606ee3475e7210b1daf30
Status: Downloaded newer image for harbor.ratp.com/library/garethflowers/svn-server:1.2.2
datadev@data-dev ~/xxxx/docker2019/docker-fileserv/svn-server$

----------------------------------------------------------------------------------
datadev@data-dev ~/xxxx/docker2019/docker-fileserv/svn-server$ sudo mkdir -p /data/svn-repo
----------------------------------------------------------------------------------
sudo docker run -d --name svn-serv \
    -p 3690:3690 \
    -v /data/svn-repo:/var/opt/svn \
    harbor.ratp.com/library/garethflowers/svn-server:1.2.2
----------------------------------------------------------------------------------
datadev@data-dev ~/xxxx/docker2019/docker-fileserv/svn-server$ ./run-svn.sh 
[sudo] password for datadev: 
Sorry, try again.
[sudo] password for datadev: 
c7c62732ebbbbf20be5e70ba96d1fe74a9e88890b3b20d2f4240c12fbf25143e
datadev@data-dev ~/xxxx/docker2019/docker-fileserv/svn-server$ sudo docker ps -a
CONTAINER ID        IMAGE                                                     COMMAND                  CREATED             STATUS                            PORTS                                                                                                                      NAMES
c7c62732ebbb        harbor.ratp.com/library/garethflowers/svn-server:1.2.2    "/usr/bin/svnserve..."   5 seconds ago       Up 4 seconds (health: starting)   0.0.0.0:3690->3690/tcp                                                                                                     svn-serv
118c30803549        dperson/samba:20180228                                    "samba.sh samba.sh..."   17 hours ago        Up 17 hours (healthy)             0.0.0.0:139->139/tcp, 137-138/udp, 0.0.0.0:445->445/tcp                                                                    samba
----------------------------------------------------------------------------------
datadev@data-dev ~/xxxx/docker2019/docker-fileserv/svn-server$ sudo docker exec -it svn-serv /bin/sh  
/var/opt/svn # env
HOSTNAME=c7c62732ebbb
SHLVL=1
HOME=/root
TERM=xterm
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/var/opt/svn
/var/opt/svn # ls
/var/opt/svn # 
/var/opt/svn # which svnadmin
/usr/bin/svnadmin
/var/opt/svn # svnadmin --help
general usage: svnadmin SUBCOMMAND REPOS_PATH  [ARGS & OPTIONS ...]
Subversion repository administration tool.
Type 'svnadmin help <subcommand>' for help on a specific subcommand.
Type 'svnadmin --version' to see the program version and FS modules.

Available subcommands:
   crashtest
   create
   delrevprop
   deltify
   dump
   dump-revprops
   freeze
   help (?, h)
   hotcopy
   info
   list-dblogs
   list-unused-dblogs
   load
   load-revprops
   lock
   lslocks
   lstxns
   pack
   recover
   rmlocks
   rmtxns
   setlog
   setrevprop
   setuuid
   unlock
   upgrade
   verify

/var/opt/svn # 
/var/opt/svn # svnadmin --version
svnadmin, version 1.11.1 (r1850623)
   compiled Jan 28 2019, 16:16:33 on x86_64-alpine-linux-musl

Copyright (C) 2019 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/

The following repository back-end (FS) modules are available:

* fs_fs : Module for working with a plain file (FSFS) repository.
* fs_x : Module for working with an experimental (FSX) repository.
* fs_base : Module for working with a Berkeley DB repository.

/var/opt/svn # 
/var/opt/svn # svnadmin help create
create: usage: svnadmin create REPOS_PATH

Create a new, empty repository at REPOS_PATH.

Valid options:
  --bdb-txn-nosync         : disable fsync at transaction commit [Berkeley DB]
  --bdb-log-keep           : disable automatic log file removal [Berkeley DB]
  --config-dir ARG         : read user configuration files from directory ARG
  --fs-type ARG            : type of repository:
                             'fsfs' (default), 'bdb' or 'fsx'
                             CAUTION: FSX is for EXPERIMENTAL use only!
  --compatible-version ARG : use repository format compatible with Subversion
                             version ARG ("1.5.5", "1.7", etc.)
  --pre-1.4-compatible     : deprecated; see --compatible-version
  --pre-1.5-compatible     : deprecated; see --compatible-version
  --pre-1.6-compatible     : deprecated; see --compatible-version

/var/opt/svn # 
/var/opt/svn # ps ax
PID   USER     TIME  COMMAND
    1 root      0:00 /usr/bin/svnserve --daemon --foreground --root /var/opt/svn
   35 root      0:00 /bin/sh
  209 root      0:00 ps ax
/var/opt/svn # 
----------------------------------------------------------------------------------
/var/opt/svn # svnadmin create SATP文档库
/var/opt/svn # ls
SATP文档库
/var/opt/svn # 
----------------------------------------------------------------------------------
datadev@data-dev ~/xxxx/docker2019/docker-fileserv/svn-server$ ls /data/svn-repo/
SATP文档库
datadev@data-dev ~/xxxx/docker2019/docker-fileserv/svn-server$ ls /data/svn-repo/SATP文档库/ -la
total 32
drwxr-xr-x 6 root root 4096 Jun  5 15:10 .
drwxr-xr-x 3 root root 4096 Jun  5 15:10 ..
drwxr-xr-x 2 root root 4096 Jun  5 15:10 conf
drwxr-sr-x 6 root root 4096 Jun  5 15:10 db
-r--r--r-- 1 root root    2 Jun  5 15:10 format
drwxr-xr-x 2 root root 4096 Jun  5 15:10 hooks
drwxr-xr-x 2 root root 4096 Jun  5 15:10 locks
-rw-r--r-- 1 root root  246 Jun  5 15:10 README.txt
datadev@data-dev ~/xxxx/docker2019/docker-fileserv/svn-server$ 
----------------------------------------------------------------------------------
/var/opt/svn # svnadmin create test
/var/opt/svn # ls
SATP文档库  test
/var/opt/svn # 
----------------------------------------------------------------------------------
use TortoiseSVN to access: svn://10.17.22.210:3690/SATP文档库
svn://10.17.22.210/SATP文档库
----------------------------------------------------------------------------------
Add users and set the password:
----------------------------------------------------------------------------------
/var/opt/svn/SATP文档库 # cd conf/
/var/opt/svn/SATP文档库/conf # ls
authz           hooks-env.tmpl  passwd          svnserve.conf
/var/opt/svn/SATP文档库/conf # ls -l
total 20
-rw-r--r--    1 root     root          1080 Jun  5 07:10 authz
-rw-r--r--    1 root     root           885 Jun  5 07:10 hooks-env.tmpl
-rw-r--r--    1 root     root           309 Jun  5 07:10 passwd
-rw-r--r--    1 root     root          4375 Jun  5 07:10 svnserve.conf
/var/opt/svn/SATP文档库/conf # 
----------------------------------------------------------------------------------
/var/opt/svn/SATP文档库/conf # cat authz 
### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to:
###  - a single user,
###  - a group of users defined in a special [groups] section,
###  - an alias defined in a special [aliases] section,
###  - all authenticated users, using the '$authenticated' token,
###  - only anonymous users, using the '$anonymous' token,
###  - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').

[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe

# [/foo/bar]
# harry = rw
# &joe = r
# * =

# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
/var/opt/svn/SATP文档库/conf # cat passwd 
### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.

[users]
# harry = harryssecret
# sally = sallyssecret
/var/opt/svn/SATP文档库/conf # cat svnserve.conf 
### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository.  (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)

### Visit http://subversion.apache.org/ for more information.

[general]
### The anon-access and auth-access options control access to the
### repository for unauthenticated (a.k.a. anonymous) users and
### authenticated users, respectively.
### Valid values are "write", "read", and "none".
### Setting the value to "none" prohibits both reading and writing;
### "read" allows read-only access, and "write" allows complete 
### read/write access to the repository.
### The sample settings below are the defaults and specify that anonymous
### users have read-only access to the repository, while authenticated
### users have read and write access to the repository.
# anon-access = read
# auth-access = write
### The password-db option controls the location of the password
### database file.  Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
# password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control.  Unless you specify a path
### starting with a /, the file's location is relative to the
### directory containing this file.  The specified path may be a
### repository relative URL (^/) or an absolute file:// URL to a text
### file in a Subversion repository.  If you don't specify an authz-db,
### no path-based access control is done.
### Uncomment the line below to use the default authorization file.
# authz-db = authz
### The groups-db option controls the location of the file with the
### group definitions and allows maintaining groups separately from the
### authorization rules.  The groups-db file is of the same format as the
### authz-db file and should contain a single [groups] section with the
### group definitions.  If the option is enabled, the authz-db file cannot
### contain a [groups] section.  Unless you specify a path starting with
### a /, the file's location is relative to the directory containing this
### file.  The specified path may be a repository relative URL (^/) or an
### absolute file:// URL to a text file in a Subversion repository.
### This option is not being used by default.
# groups-db = groups
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa.  The default realm
### is repository's uuid.
# realm = My First Repository
### The force-username-case option causes svnserve to case-normalize
### usernames before comparing them against the authorization rules in the
### authz-db file configured above.  Valid values are "upper" (to upper-
### case the usernames), "lower" (to lowercase the usernames), and
### "none" (to compare usernames as-is without case conversion, which
### is the default behavior).
# force-username-case = none
### The hooks-env options specifies a path to the hook script environment 
### configuration file. This option overrides the per-repository default
### and can be used to configure the hook script environment for multiple 
### repositories in a single file, if an absolute path is specified.
### Unless you specify an absolute path, the file's location is relative
### to the directory containing this file.
# hooks-env = hooks-env

[sasl]
### This option specifies whether you want to use the Cyrus SASL
### library for authentication. Default is false.
### Enabling this option requires svnserve to have been built with Cyrus
### SASL support; to check, run 'svnserve --version' and look for a line
### reading 'Cyrus SASL authentication is available.'
# use-sasl = true
### These options specify the desired strength of the security layer
### that you want SASL to provide. 0 means no encryption, 1 means
### integrity-checking only, values larger than 1 are correlated
### to the effective key length for encryption (e.g. 128 means 128-bit
### encryption). The values below are the defaults.
# min-encryption = 0
# max-encryption = 256
/var/opt/svn/SATP文档库/conf # 
----------------------------------------------------------------------------------
/var/opt/svn/SATP文档库/conf # vi authz

[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
team_satp = hehg,panb,zhangyt,ruanll,huangchg,lulq,linx
            
# [/foo/bar]
# harry = rw
# &joe = r
# * =
                       
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
[\]
@team-satp = rw
----------------------------------------------------------------------------------
/var/opt/svn/SATP文档库/conf # vi passwd 
/var/opt/svn/SATP文档库/conf # cat passwd 
### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.

[users]
# harry = harryssecret
# sally = sallyssecret
heh = heh
panbb = panbb
zhangyy = zhangyy
ruanll = ruanll
huangch = huangch
lul = lul
lin = lin
/var/opt/svn/SATP文档库/conf # 
heh = he.hai
panbb = pan.beib
zhangyy = zhang.youy
ruanll = ruan.lingling
huangch = huang.chu
lul = lu.lie
lin = li.ning
----------------------------------------------------------------------------------
/var/opt/svn/SATP文档库/conf # vi svnserve.conf

# anon-access = read                                                   
# auth-access = write                                                  
auth-access = write

# password-db = passwd                                                   
password-db = passwd

# realm = My First Repository                                             
realm = 10.17.191.210  
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
datadev@data-dev ~/xxxx/docker2019/docker-fileserv/svn-server$ cat docker-compose_svnserver.yml 
version: '2.1'
services:
  svnserver:
    image: harbor.ratp.com/library/garethflowers/svn-server:1.2.2
    hostname: svnserver
    container_name: svnserver
    restart: always
    ports:
      - 3690:3690
    volumes:
      - /data/svn-repo:/var/opt/svn
      #- /etc/passwd:/etc/passwd:ro
      #- /etc/group:/etc/group:ro
      - /etc/timezone:/etc/TZ:ro
      - /etc/localtime:/etc/localtime:ro

#Creating a new SVN Repository
#Use svnadmin within your container to create and manage repositories.
#For example, to create a repository called new-repo in container svnserver, use the following:
#docker exec -it svnserver svnadmin create new-repo

datadev@data-dev ~/xxxx/docker2019/docker-fileserv/svn-server$

datadev@data-dev ~/xxxx/docker2019/docker-fileserv/svn-server$ cat svnserv-up.sh 
#!/bin/bash
#
# svnserver up script
#

sudo docker-compose -f docker-compose_svnserver.yml up -d

exit

datadev@data-dev ~/xxxx/docker2019/docker-fileserv/svn-server$ cat svnserv-down.sh 
#!/bin/bash
#
# svnserver down script
#

sudo docker-compose -f docker-compose_svnserver.yml down

exit

datadev@data-dev ~/xxxx/docker2019/docker-fileserv/svn-server$

----------------------------------------------------------------------------------
$ ./svnserv-up.sh 
[sudo] password for datadev: 
WARNING: The Docker Engine you're using is running in swarm mode.

Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.

To deploy your application across the swarm, use `docker stack deploy`.

Creating network "svnserver_default" with the default driver
Creating svnserver ... 
Creating svnserver ... done
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
hub.docker.com
----------------------------------------------------------------------------------
https://hub.docker.com/r/garethflowers/svn-server

garethflowers/svn-server
By garethflowers • Updated a month ago
A simple Subversion (SVN) server, using `svnserve`.

docker pull garethflowers/svn-server:1.2.2

SVN Server
A simple Subversion server, using svnserve.

How to use this image
Start a Subversion Server instance
To start a container, with data stored in /home/svn on the host, use the following:

docker run \
    --name my-svn-server \
    --detach \
    --volume /home/svn:/var/opt/svn \
    --publish 3690:3690 \
    garethflowers/svn-server

Creating a new SVN Repository
Use svnadmin within your container to create and manage repositories.

For example, to create a repository called new-repo in container my-svn-server, use the following:

docker exec -it my-svn-server svnadmin create new-repo

License
Apache Subversion is released under the Apache License.
This image is released under the MIT License.

Tags (13)

master 6 MB
Last update: a month ago (May 3, 2019 12:35 AM)
latest 6 MB
Last update: a month ago (May 3, 2019 12:35 AM)

1.2.2 6 MB
Last update: a month ago (May 3, 2019 12:35 AM)

Dockerfile
FROM alpine:3.9

ARG BUILD_DATE
ARG VCS_REF

LABEL org.label-schema.build-date=$BUILD_DATE \
    org.label-schema.docker.cmd="docker run --detach --publish 3690:3690 --volume $PWD:/var/opt/svn garethflowers/svn-server" \
    org.label-schema.description="SVN Server" \
    org.label-schema.name="svn-server" \
    org.label-schema.schema-version="1.0" \
    org.label-schema.url="https://subversion.apache.org" \
    org.label-schema.vcs-ref=$VCS_REF \
    org.label-schema.vcs-url="https://github.com/garethflowers/docker-svn-server" \
    org.label-schema.vendor="garethflowers" \
    org.label-schema.version="1.2.2"

CMD [ "/usr/bin/svnserve", "--daemon", "--foreground", "--root", "/var/opt/svn" ]
EXPOSE 3690
HEALTHCHECK CMD netstat -ln | grep 3690 || exit 1
VOLUME [ "/var/opt/svn" ]
WORKDIR /var/opt/svn

RUN apk add --no-cache subversion==1.11.1-r0
----------------------------------------------------------------------------------

【实战Docker】SVN服务相关推荐

  1. 《三、企业级SVN运维实战:SVN服务配置https访问》

    文章目录 一.svn服务部署 二.安装httpd及svn模块 三.svn http配置 四.创建svn http用户 五.修改svn仓库配置文件 六.配置https请求svn 七.svn测试 总结:整 ...

  2. 《一、企业级SVN运维实战:SVN服务部署》

    文章目录 一.SVN部署背景 二.SVN服务部署 2.1.部署环境 2.2.系统环境 2.3.软件安装 2.3.配置文件 2.4.数据迁移 2.5.测试访问

  3. SpringCloud与Docker微服务架构实战pdf

    下载地址:网盘下载 作为一部帮助大家实现微服务架构落地的作品,<Spring Cloud与Docker微服务架构实战>覆盖了微服务理论.微服务开发框架(Spring Cloud)以及运行平 ...

  4. 【福利】赠书:Spring Cloud与Docker微服务架构实战(第2版)

    本次福利送出好友周立的第二版书籍! 正在关注和使用Spring Cloud的朋友们不要错过哦! 内容提要 <Spring Cloud与Docker微服务架构实战(第2版)>基于Spring ...

  5. 《Spring Cloud与Docker微服务架构实战》配套代码

    不才写了本使用Spring Cloud玩转微服务架构的书,书名是<Spring Cloud与Docker微服务架构实战> - 周立,已于2017-01-12交稿.不少朋友想先看看源码,现将 ...

  6. Docker实战 (docker swarm的应用,docker集群的构建,在docker集群中部署服务)

    Docker实战 ----docker swarm的应用,docker集群的构建,在docker集群中部署服务 转载来源:https://blog.csdn.net/No_red/article/de ...

  7. Rasa课程、Rasa培训、Rasa面试、Rasa实战系列之Docker Duckling服务部署

    Rasa课程.Rasa培训.Rasa面试.Rasa实战系列之Docker Duckling服务部署 vmvare 本地安装 docker Duckling服务 简介在windows 10 本地电脑上安 ...

  8. Spring Cloud与Docker微服务架构实战 PDF版 内含目录

    Spring Cloud与Docker微服务架构实战  目录 1 微服务架构概述 1 1.1 单体应用架构存在的问题1 1.2 如何解决单体应用架构存在的问题3 1.3 什么是微服务3 1.4 微服务 ...

  9. 什么是SVN,Docker环境如何安装Svn服务(http协议)

    目录 前言 1.拉起镜像 2.创建加载目录 3.启动镜像 4.配置httpd.conf 5.初始化SVN 5.配置svnadmin 5.1 初始化配置 5.2 设置管理用户 6.创建仓库.用户权限 6 ...

最新文章

  1. Survey | 基于生成模型的分子设计
  2. 如何完全卸载Java
  3. 温州大学《机器学习》课程代码(二)(回归)
  4. 读《代码整洁之道》前四章浅显印象 和 我所见的不整洁代码引以为戒
  5. java method_JAVA Method的解析
  6. [再寄小读者之数学篇](2014-11-14 矩阵的应用: 多项式)
  7. tez什么意思_传统数仓和大数据数仓的区别是什么?
  8. Python 数据分析三剑客之 Matplotlib(三):图例 / LaTeX / 刻度 / 子图 / 补丁等基本图像属性
  9. 宣称“禁用新疆产品”,英特尔紧急道歉:出于表述合规合法初衷
  10. IE环境下判断IE版本的语句...[if lte IE 6]……[endif][if lte IE 7]……[endif]
  11. 毕设项目,系统搭建笔记文档
  12. vmware 安装及使用虚拟机注意事项
  13. Win8 Metro(C#)数字图像处理--2.39二值图像投影
  14. axios封装接口步骤详解
  15. OPERA固定价格学习
  16. 电子罗盘电磁干扰_车载电子罗盘中的一种新型抗干扰设计
  17. 线性代数02 线性方程组的解的情况(矩阵的秩)
  18. 前端成长之路之打好根基
  19. 2013中国Linux内核开发者大会亮点汇总
  20. Excel シートインポート、Excel シートエクスポート

热门文章

  1. 自然语言处理学习2:英语分词1word_tokenize, WordPunctTokenizer, TreebankWordTokenizer , WhitespaceTokenizer等
  2. 科普--电脑显示的硬盘容量为什么比标称的要小?
  3. Latex排版—(2)基本结构
  4. 华为云数字资产链,构建新型数字经济价值
  5. android模拟power按键,Android adb 模拟滑动 按键 点击事件
  6. 太棒了,Python和算法简直是绝配
  7. word计算机二级视频教程,计算机二级Office入门及上机实践视频教程之Word篇
  8. 微信什么时候支持鸿蒙,若微信只支持鸿蒙抛弃安卓,结果如何?别傻了,腾讯不会“作死”...
  9. 【逗老师带你学IT】ZoomRooms兼容硬件设计方案
  10. 成就你一生的100个哲理11-20