docker的ubuntu的镜像中安装SVN并使用

  1. 安装ubuntu镜像
    docker pull ubuntu

  2. 启动ubuntu
    docker run -ti ubuntu /bin/bash
    进入shell

  3. 在ubuntu中安装subversion
    1)apt-get update
    2)apt-get install nano
    3)修改ubuntu的下载源 nano /etc/apt/sources.list
    用阿里的替换

    deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    

    4)安装subversion
    apt-get install subversion

  4. 建好svn仓库,设置参数,参考 Ubuntu使用svn

  5. 将本container保存为docker的镜像,不保存的话前面安装配置的东西就都丢失了
    docker commit 1979cf3371fb(确认好container的id) ubuntu-svn

  6. 启动刚保存的ubuntu-svn镜像
    docker run -ti -p 3691:3690 ubuntu-svn sh -c "svnserve -d -r /svn && /bin/bash"
    -p 3691:3690是把svn的默认端口3690映射给宿主机
    sh -c 用于执行多条命令, 要先启用svn服务,然后进到shell

  7. 宿主机访问docker中的svn服务
    确认docker的ip


    svn://10.0.75.1:3691/project

你可能感兴趣的:(docker的ubuntu的镜像中安装SVN并使用)