Docker管理-基于CentOS通過Dockerfile制作SVN鏡像

1登失、創(chuàng)建Dockerfile文件

[root@Server ~]# mkdir /usr/dockerfile
[root@Server ~]# cd /usr/dockerfile/
[root@Server dockerfile]# vi Dockerfile
# CentOS-8.1.1911-SVN
FROM centos:8.1.1911

# 安裝并配置subversion
RUN yum -y update && yum install -y subversion && mkdir -p /usr/svn/repository && svnadmin create /usr/svn/repository && chmod -R 775 /usr/svn/repository/db && cd /usr/svn/repository/conf/ && sed -i -e 's/# anon-access = read/anon-access = none/g' -e 's/# auth-access = write/auth-access = write/g' -e 's/# password-db = passwd/password-db = passwd/g' -e 's/# authz-db = authz/authz-db = authz/g' -e 's/# realm = My First Repository/realm = repository/g' ./svnserve.conf && sed -i '$a\admin = 1qaz@WSX' ./passwd && sed -i -e '$a\admin = admin' -e '$a\[repository:/]' -e '$a\@admin = rw' ./authz

# 安裝并配置ssh
RUN yum install -y openssh-server && sed -i -e 's/#LoginGraceTime 2m/LoginGraceTime 2m/g' -e 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' -e 's/#StrictModes yes/StrictModes yes/g' /etc/ssh/sshd_config && mkdir /var/run/sshd && echo 'UseDNS no' >> /etc/ssh/sshd_config && sed -i -e '/pam_loginuid.so/d' /etc/pam.d/sshd && echo 'root:1qaz@WSX' | chpasswd && /usr/bin/ssh-keygen -A

# 復(fù)制init.sh文件復(fù)制到/usr/svn/
COPY init.sh /usr/svn/

# 聲明svnserve的服務(wù)端口
EXPOSE 3690

# 容器啟動(dòng)時(shí)執(zhí)行"/bin/bash /usr/svn/init.sh"
CMD ["/bin/bash","/usr/svn/init.sh"]

2、使用Dockerfile構(gòu)建鏡像

[root@Server dockerfile]# vi init.sh
#!/bin/bash
/usr/bin/svnserve -d -r /usr/svn/
/usr/sbin/sshd -D
[root@Server dockerfile]# ls -l
total 8
-rw-r--r-- 1 root root 1266 Apr 19 14:25 Dockerfile
-rw-r--r-- 1 root root   67 Apr 19 14:26 init.sh
[root@Server dockerfile]# docker image ls -a
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
[root@Server dockerfile]# docker build -t "kevin/svnsrv:1.13.0" .
Sending build context to Docker daemon  4.096kB
Step 1/6 : FROM centos:8.1.1911
8.1.1911: Pulling from library/centos
8a29a15cefae: Pull complete
Digest: sha256:fe8d824220415eed5477b63addf40fb06c3b049404242b31982106ac204f6700
Status: Downloaded newer image for centos:8.1.1911
 ---> 470671670cac
Step 2/6 : RUN yum -y update && yum install -y subversion && mkdir -p /usr/svn/repository && svnadmin create /usr/svn/repository && chmod -R 775 /usr/svn/repository/db && cd /usr/svn/repository/conf/ && sed -i -e 's/# anon-access = read/anon-access = none/g' -e 's/# auth-access = write/auth-access = write/g' -e 's/# password-db = passwd/password-db = passwd/g' -e 's/# authz-db = authz/authz-db = authz/g' -e 's/# realm = My First Repository/realm = repository/g' ./svnserve.conf && sed -i '$a\admin = 1qaz@WSX' ./passwd && sed -i -e '$a\admin = admin' -e '$a\[repository:/]' -e '$a\@admin = rw' ./authz
 ---> Running in 50105d860dc9
CentOS-8 - AppStream                            2.5 MB/s | 6.8 MB     00:02
CentOS-8 - Base                                 2.8 MB/s | 6.0 MB     00:02
CentOS-8 - Extras                               399  B/s | 5.5 kB     00:14
Dependencies resolved.
================================================================================
 Package                Arch   Version                          Repo       Size
================================================================================
Upgrading:
 audit-libs             x86_64 3.0-0.13.20190507gitf58ec40.el8  BaseOS    116 k
 binutils               x86_64 2.30-58.el8_1.2                  BaseOS    5.7 M
 centos-gpg-keys        noarch 8.1-1.1911.0.9.el8               BaseOS     12 k
 centos-release         x86_64 8.1-1.1911.0.9.el8               BaseOS     21 k
 centos-repos           x86_64 8.1-1.1911.0.9.el8               BaseOS     13 k
 coreutils-single       x86_64 8.30-6.el8_1.1                   BaseOS    630 k
 glibc                  x86_64 2.28-72.el8_1.1                  BaseOS    3.7 M
 glibc-common           x86_64 2.28-72.el8_1.1                  BaseOS    836 k
 glibc-minimal-langpack x86_64 2.28-72.el8_1.1                  BaseOS     48 k
 kexec-tools            x86_64 2.0.19-12.el8_1.2                BaseOS    482 k
 libarchive             x86_64 3.3.2-8.el8_1                    BaseOS    359 k
 openldap               x86_64 2.4.46-11.el8_1                  BaseOS    352 k
 openssl-libs           x86_64 1:1.1.1c-2.el8_1.1               BaseOS    1.5 M
 python3-rpm            x86_64 4.14.2-26.el8_1                  BaseOS    156 k
 rpm                    x86_64 4.14.2-26.el8_1                  BaseOS    539 k
 rpm-build-libs         x86_64 4.14.2-26.el8_1                  BaseOS    153 k
 rpm-libs               x86_64 4.14.2-26.el8_1                  BaseOS    336 k
 sqlite-libs            x86_64 3.26.0-4.el8_1                   BaseOS    579 k
 systemd                x86_64 239-18.el8_1.5                   BaseOS    3.5 M
 systemd-libs           x86_64 239-18.el8_1.5                   BaseOS    562 k
 systemd-pam            x86_64 239-18.el8_1.5                   BaseOS    232 k
 systemd-udev           x86_64 239-18.el8_1.5                   BaseOS    1.3 M
Installing dependencies:
 xkeyboard-config       noarch 2.24-3.el8                       AppStream 828 k
 kbd-legacy             noarch 2.0.4-8.el8                      BaseOS    481 k
 kbd-misc               noarch 2.0.4-8.el8                      BaseOS    1.4 M
 openssl                x86_64 1:1.1.1c-2.el8_1.1               BaseOS    686 k
Installing weak dependencies:
 libxkbcommon           x86_64 0.8.2-1.el8                      AppStream 116 k
 diffutils              x86_64 3.6-5.el8                        BaseOS    359 k
 glibc-langpack-en      x86_64 2.28-72.el8_1.1                  BaseOS    818 k
 kbd                    x86_64 2.0.4-8.el8                      BaseOS    392 k
 openssl-pkcs11         x86_64 0.4.8-2.el8                      BaseOS     64 k

Transaction Summary
================================================================================
Install   9 Packages
Upgrade  22 Packages

Total download size: 26 M
Downloading Packages:
(1/31): libxkbcommon-0.8.2-1.el8.x86_64.rpm     326 kB/s | 116 kB     00:00
(2/31): xkeyboard-config-2.24-3.el8.noarch.rpm  1.9 MB/s | 828 kB     00:00
(3/31): diffutils-3.6-5.el8.x86_64.rpm          652 kB/s | 359 kB     00:00
(4/31): glibc-langpack-en-2.28-72.el8_1.1.x86_6 1.1 MB/s | 818 kB     00:00
(5/31): kbd-legacy-2.0.4-8.el8.noarch.rpm       887 kB/s | 481 kB     00:00
(6/31): kbd-2.0.4-8.el8.x86_64.rpm              415 kB/s | 392 kB     00:00
(7/31): openssl-1.1.1c-2.el8_1.1.x86_64.rpm     1.2 MB/s | 686 kB     00:00
(8/31): openssl-pkcs11-0.4.8-2.el8.x86_64.rpm   202 kB/s |  64 kB     00:00
(9/31): kbd-misc-2.0.4-8.el8.noarch.rpm         2.2 MB/s | 1.4 MB     00:00
(10/31): centos-gpg-keys-8.1-1.1911.0.9.el8.noa  86 kB/s |  12 kB     00:00
(11/31): audit-libs-3.0-0.13.20190507gitf58ec40 298 kB/s | 116 kB     00:00
(12/31): centos-release-8.1-1.1911.0.9.el8.x86_  98 kB/s |  21 kB     00:00
(13/31): centos-repos-8.1-1.1911.0.9.el8.x86_64  96 kB/s |  13 kB     00:00
(14/31): binutils-2.30-58.el8_1.2.x86_64.rpm    3.2 MB/s | 5.7 MB     00:01
(15/31): glibc-common-2.28-72.el8_1.1.x86_64.rp 1.4 MB/s | 836 kB     00:00
(16/31): coreutils-single-8.30-6.el8_1.1.x86_64 310 kB/s | 630 kB     00:02
(17/31): glibc-minimal-langpack-2.28-72.el8_1.1 175 kB/s |  48 kB     00:00
(18/31): kexec-tools-2.0.19-12.el8_1.2.x86_64.r 412 kB/s | 482 kB     00:01
(19/31): glibc-2.28-72.el8_1.1.x86_64.rpm       1.1 MB/s | 3.7 MB     00:03
(20/31): openldap-2.4.46-11.el8_1.x86_64.rpm    572 kB/s | 352 kB     00:00
(21/31): libarchive-3.3.2-8.el8_1.x86_64.rpm    196 kB/s | 359 kB     00:01
(22/31): python3-rpm-4.14.2-26.el8_1.x86_64.rpm 375 kB/s | 156 kB     00:00
(23/31): openssl-libs-1.1.1c-2.el8_1.1.x86_64.r 1.7 MB/s | 1.5 MB     00:00
(24/31): rpm-4.14.2-26.el8_1.x86_64.rpm         1.1 MB/s | 539 kB     00:00
(25/31): rpm-build-libs-4.14.2-26.el8_1.x86_64. 360 kB/s | 153 kB     00:00
(26/31): rpm-libs-4.14.2-26.el8_1.x86_64.rpm    674 kB/s | 336 kB     00:00
(27/31): sqlite-libs-3.26.0-4.el8_1.x86_64.rpm  755 kB/s | 579 kB     00:00
(28/31): systemd-libs-239-18.el8_1.5.x86_64.rpm 471 kB/s | 562 kB     00:01
(29/31): systemd-239-18.el8_1.5.x86_64.rpm      1.4 MB/s | 3.5 MB     00:02
(30/31): systemd-pam-239-18.el8_1.5.x86_64.rpm  133 kB/s | 232 kB     00:01
(31/31): systemd-udev-239-18.el8_1.5.x86_64.rpm 1.1 MB/s | 1.3 MB     00:01
--------------------------------------------------------------------------------
Total                                           1.4 MB/s |  26 MB     00:18
warning: /var/cache/dnf/AppStream-02e86d1c976ab532/packages/libxkbcommon-0.8.2-1.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
CentOS-8 - AppStream                            1.6 MB/s | 1.6 kB     00:00
Importing GPG key 0x8483C65D:
 Userid     : "CentOS (CentOS Official Signing Key) <security@centos.org>"
 Fingerprint: 99DB 70FA E1D7 CE22 7FB6 4882 05B5 55B3 8483 C65D
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Running scriptlet: centos-gpg-keys-8.1-1.1911.0.9.el8.noarch              1/1
  Upgrading        : centos-gpg-keys-8.1-1.1911.0.9.el8.noarch             1/53
  Upgrading        : centos-release-8.1-1.1911.0.9.el8.x86_64              2/53
  Upgrading        : centos-repos-8.1-1.1911.0.9.el8.x86_64                3/53
  Upgrading        : glibc-common-2.28-72.el8_1.1.x86_64                   4/53
  Running scriptlet: glibc-2.28-72.el8_1.1.x86_64                          5/53
  Upgrading        : glibc-2.28-72.el8_1.1.x86_64                          5/53
  Running scriptlet: glibc-2.28-72.el8_1.1.x86_64                          5/53
  Installing       : glibc-langpack-en-2.28-72.el8_1.1.x86_64              6/53
  Upgrading        : coreutils-single-8.30-6.el8_1.1.x86_64                7/53
  Upgrading        : audit-libs-3.0-0.13.20190507gitf58ec40.el8.x86_64     8/53
  Installing       : openssl-1:1.1.1c-2.el8_1.1.x86_64                     9/53
  Installing       : openssl-pkcs11-0.4.8-2.el8.x86_64                    10/53
  Running scriptlet: openssl-pkcs11-0.4.8-2.el8.x86_64                    10/53
  Upgrading        : openssl-libs-1:1.1.1c-2.el8_1.1.x86_64               11/53
  Running scriptlet: openssl-libs-1:1.1.1c-2.el8_1.1.x86_64               11/53
  Upgrading        : libarchive-3.3.2-8.el8_1.x86_64                      12/53
  Upgrading        : rpm-4.14.2-26.el8_1.x86_64                           13/53
  Upgrading        : rpm-libs-4.14.2-26.el8_1.x86_64                      14/53
  Running scriptlet: rpm-libs-4.14.2-26.el8_1.x86_64                      14/53
  Upgrading        : rpm-build-libs-4.14.2-26.el8_1.x86_64                15/53
  Running scriptlet: rpm-build-libs-4.14.2-26.el8_1.x86_64                15/53
  Upgrading        : systemd-libs-239-18.el8_1.5.x86_64                   16/53
  Running scriptlet: systemd-libs-239-18.el8_1.5.x86_64                   16/53
  Installing       : diffutils-3.6-5.el8.x86_64                           17/53
  Running scriptlet: diffutils-3.6-5.el8.x86_64                           17/53
  Installing       : kbd-misc-2.0.4-8.el8.noarch                          18/53
  Installing       : kbd-legacy-2.0.4-8.el8.noarch                        19/53
  Installing       : kbd-2.0.4-8.el8.x86_64                               20/53
  Installing       : xkeyboard-config-2.24-3.el8.noarch                   21/53
  Installing       : libxkbcommon-0.8.2-1.el8.x86_64                      22/53
  Upgrading        : systemd-pam-239-18.el8_1.5.x86_64                    23/53
  Running scriptlet: systemd-239-18.el8_1.5.x86_64                        24/53
  Upgrading        : systemd-239-18.el8_1.5.x86_64                        24/53
  Running scriptlet: systemd-239-18.el8_1.5.x86_64                        24/53
  Upgrading        : kexec-tools-2.0.19-12.el8_1.2.x86_64                 25/53
  Running scriptlet: kexec-tools-2.0.19-12.el8_1.2.x86_64                 25/53
  Upgrading        : systemd-udev-239-18.el8_1.5.x86_64                   26/53
  Running scriptlet: systemd-udev-239-18.el8_1.5.x86_64                   26/53
  Upgrading        : python3-rpm-4.14.2-26.el8_1.x86_64                   27/53
  Upgrading        : openldap-2.4.46-11.el8_1.x86_64                      28/53
  Upgrading        : binutils-2.30-58.el8_1.2.x86_64                      29/53
  Running scriptlet: binutils-2.30-58.el8_1.2.x86_64                      29/53
  Upgrading        : glibc-minimal-langpack-2.28-72.el8_1.1.x86_64        30/53
  Upgrading        : sqlite-libs-3.26.0-4.el8_1.x86_64                    31/53
  Cleanup          : systemd-udev-239-18.el8_1.1.x86_64                   32/53
  Running scriptlet: systemd-udev-239-18.el8_1.1.x86_64                   32/53
  Running scriptlet: kexec-tools-2.0.19-12.el8_1.1.x86_64                 33/53
  Cleanup          : kexec-tools-2.0.19-12.el8_1.1.x86_64                 33/53
  Running scriptlet: kexec-tools-2.0.19-12.el8_1.1.x86_64                 33/53
  Running scriptlet: systemd-239-18.el8_1.1.x86_64                        34/53
  Cleanup          : systemd-239-18.el8_1.1.x86_64                        34/53
  Cleanup          : systemd-libs-239-18.el8_1.1.x86_64                   35/53
  Cleanup          : systemd-pam-239-18.el8_1.1.x86_64                    36/53
  Cleanup          : openldap-2.4.46-10.el8.x86_64                        37/53
  Cleanup          : python3-rpm-4.14.2-25.el8.x86_64                     38/53
  Cleanup          : rpm-build-libs-4.14.2-25.el8.x86_64                  39/53
  Running scriptlet: rpm-build-libs-4.14.2-25.el8.x86_64                  39/53
  Cleanup          : rpm-4.14.2-25.el8.x86_64                             40/53
  Cleanup          : rpm-libs-4.14.2-25.el8.x86_64                        41/53
  Running scriptlet: rpm-libs-4.14.2-25.el8.x86_64                        41/53
  Running scriptlet: binutils-2.30-58.el8.0.1.x86_64                      42/53
  Cleanup          : binutils-2.30-58.el8.0.1.x86_64                      42/53
  Running scriptlet: binutils-2.30-58.el8.0.1.x86_64                      42/53
  Cleanup          : centos-release-8.1-1.1911.0.8.el8.x86_64             43/53
  Cleanup          : coreutils-single-8.30-6.el8.x86_64                   44/53
  Cleanup          : libarchive-3.3.2-7.el8.x86_64                        45/53
  Cleanup          : openssl-libs-1:1.1.1c-2.el8.x86_64                   46/53
  Running scriptlet: openssl-libs-1:1.1.1c-2.el8.x86_64                   46/53
  Cleanup          : sqlite-libs-3.26.0-3.el8.x86_64                      47/53
  Cleanup          : audit-libs-3.0-0.10.20180831git0047a6c.el8.x86_64    48/53
  Cleanup          : centos-repos-8.1-1.1911.0.8.el8.x86_64               49/53
  Cleanup          : glibc-2.28-72.el8.x86_64                             50/53
  Cleanup          : glibc-minimal-langpack-2.28-72.el8.x86_64            51/53
  Cleanup          : centos-gpg-keys-8.1-1.1911.0.8.el8.noarch            52/53
  Cleanup          : glibc-common-2.28-72.el8.x86_64                      53/53
  Running scriptlet: glibc-common-2.28-72.el8.x86_64                      53/53
  Running scriptlet: glibc-common-2.28-72.el8_1.1.x86_64                  53/53
  Running scriptlet: systemd-239-18.el8_1.5.x86_64                        53/53
  Running scriptlet: systemd-udev-239-18.el8_1.5.x86_64                   53/53
  Verifying        : libxkbcommon-0.8.2-1.el8.x86_64                       1/53
  Verifying        : xkeyboard-config-2.24-3.el8.noarch                    2/53
  Verifying        : diffutils-3.6-5.el8.x86_64                            3/53
  Verifying        : glibc-langpack-en-2.28-72.el8_1.1.x86_64              4/53
  Verifying        : kbd-2.0.4-8.el8.x86_64                                5/53
  Verifying        : kbd-legacy-2.0.4-8.el8.noarch                         6/53
  Verifying        : kbd-misc-2.0.4-8.el8.noarch                           7/53
  Verifying        : openssl-1:1.1.1c-2.el8_1.1.x86_64                     8/53
  Verifying        : openssl-pkcs11-0.4.8-2.el8.x86_64                     9/53
  Verifying        : audit-libs-3.0-0.13.20190507gitf58ec40.el8.x86_64    10/53
  Verifying        : audit-libs-3.0-0.10.20180831git0047a6c.el8.x86_64    11/53
  Verifying        : binutils-2.30-58.el8_1.2.x86_64                      12/53
  Verifying        : binutils-2.30-58.el8.0.1.x86_64                      13/53
  Verifying        : centos-gpg-keys-8.1-1.1911.0.9.el8.noarch            14/53
  Verifying        : centos-gpg-keys-8.1-1.1911.0.8.el8.noarch            15/53
  Verifying        : centos-release-8.1-1.1911.0.9.el8.x86_64             16/53
  Verifying        : centos-release-8.1-1.1911.0.8.el8.x86_64             17/53
  Verifying        : centos-repos-8.1-1.1911.0.9.el8.x86_64               18/53
  Verifying        : centos-repos-8.1-1.1911.0.8.el8.x86_64               19/53
  Verifying        : coreutils-single-8.30-6.el8_1.1.x86_64               20/53
  Verifying        : coreutils-single-8.30-6.el8.x86_64                   21/53
  Verifying        : glibc-2.28-72.el8_1.1.x86_64                         22/53
  Verifying        : glibc-2.28-72.el8.x86_64                             23/53
  Verifying        : glibc-common-2.28-72.el8_1.1.x86_64                  24/53
  Verifying        : glibc-common-2.28-72.el8.x86_64                      25/53
  Verifying        : glibc-minimal-langpack-2.28-72.el8_1.1.x86_64        26/53
  Verifying        : glibc-minimal-langpack-2.28-72.el8.x86_64            27/53
  Verifying        : kexec-tools-2.0.19-12.el8_1.2.x86_64                 28/53
  Verifying        : kexec-tools-2.0.19-12.el8_1.1.x86_64                 29/53
  Verifying        : libarchive-3.3.2-8.el8_1.x86_64                      30/53
  Verifying        : libarchive-3.3.2-7.el8.x86_64                        31/53
  Verifying        : openldap-2.4.46-11.el8_1.x86_64                      32/53
  Verifying        : openldap-2.4.46-10.el8.x86_64                        33/53
  Verifying        : openssl-libs-1:1.1.1c-2.el8_1.1.x86_64               34/53
  Verifying        : openssl-libs-1:1.1.1c-2.el8.x86_64                   35/53
  Verifying        : python3-rpm-4.14.2-26.el8_1.x86_64                   36/53
  Verifying        : python3-rpm-4.14.2-25.el8.x86_64                     37/53
  Verifying        : rpm-4.14.2-26.el8_1.x86_64                           38/53
  Verifying        : rpm-4.14.2-25.el8.x86_64                             39/53
  Verifying        : rpm-build-libs-4.14.2-26.el8_1.x86_64                40/53
  Verifying        : rpm-build-libs-4.14.2-25.el8.x86_64                  41/53
  Verifying        : rpm-libs-4.14.2-26.el8_1.x86_64                      42/53
  Verifying        : rpm-libs-4.14.2-25.el8.x86_64                        43/53
  Verifying        : sqlite-libs-3.26.0-4.el8_1.x86_64                    44/53
  Verifying        : sqlite-libs-3.26.0-3.el8.x86_64                      45/53
  Verifying        : systemd-239-18.el8_1.5.x86_64                        46/53
  Verifying        : systemd-239-18.el8_1.1.x86_64                        47/53
  Verifying        : systemd-libs-239-18.el8_1.5.x86_64                   48/53
  Verifying        : systemd-libs-239-18.el8_1.1.x86_64                   49/53
  Verifying        : systemd-pam-239-18.el8_1.5.x86_64                    50/53
  Verifying        : systemd-pam-239-18.el8_1.1.x86_64                    51/53
  Verifying        : systemd-udev-239-18.el8_1.5.x86_64                   52/53
  Verifying        : systemd-udev-239-18.el8_1.1.x86_64                   53/53

Upgraded:
  audit-libs-3.0-0.13.20190507gitf58ec40.el8.x86_64
  binutils-2.30-58.el8_1.2.x86_64
  centos-gpg-keys-8.1-1.1911.0.9.el8.noarch
  centos-release-8.1-1.1911.0.9.el8.x86_64
  centos-repos-8.1-1.1911.0.9.el8.x86_64
  coreutils-single-8.30-6.el8_1.1.x86_64
  glibc-2.28-72.el8_1.1.x86_64
  glibc-common-2.28-72.el8_1.1.x86_64
  glibc-minimal-langpack-2.28-72.el8_1.1.x86_64
  kexec-tools-2.0.19-12.el8_1.2.x86_64
  libarchive-3.3.2-8.el8_1.x86_64
  openldap-2.4.46-11.el8_1.x86_64
  openssl-libs-1:1.1.1c-2.el8_1.1.x86_64
  python3-rpm-4.14.2-26.el8_1.x86_64
  rpm-4.14.2-26.el8_1.x86_64
  rpm-build-libs-4.14.2-26.el8_1.x86_64
  rpm-libs-4.14.2-26.el8_1.x86_64
  sqlite-libs-3.26.0-4.el8_1.x86_64
  systemd-239-18.el8_1.5.x86_64
  systemd-libs-239-18.el8_1.5.x86_64
  systemd-pam-239-18.el8_1.5.x86_64
  systemd-udev-239-18.el8_1.5.x86_64

Installed:
  libxkbcommon-0.8.2-1.el8.x86_64           diffutils-3.6-5.el8.x86_64
  glibc-langpack-en-2.28-72.el8_1.1.x86_64  kbd-2.0.4-8.el8.x86_64
  openssl-pkcs11-0.4.8-2.el8.x86_64         xkeyboard-config-2.24-3.el8.noarch
  kbd-legacy-2.0.4-8.el8.noarch             kbd-misc-2.0.4-8.el8.noarch
  openssl-1:1.1.1c-2.el8_1.1.x86_64

Complete!
Last metadata expiration check: 0:00:40 ago on Sun Apr 19 07:14:51 2020.
Dependencies resolved.
================================================================================
 Package          Arch   Version                                Repo       Size
================================================================================
Installing:
 subversion       x86_64 1.10.2-1.module_el8.0.0+45+75bba4f4    AppStream 1.1 M
Installing dependencies:
 apr              x86_64 1.6.3-9.el8                            AppStream 125 k
 apr-util         x86_64 1.6.1-6.el8                            AppStream 105 k
 libserf          x86_64 1.3.9-8.module_el8.0.0+45+75bba4f4     AppStream  60 k
 subversion-libs  x86_64 1.10.2-1.module_el8.0.0+45+75bba4f4    AppStream 1.5 M
 utf8proc         x86_64 2.1.1-4.module_el8.0.0+45+75bba4f4     AppStream  67 k
Installing weak dependencies:
 apr-util-bdb     x86_64 1.6.1-6.el8                            AppStream  25 k
 apr-util-openssl x86_64 1.6.1-6.el8                            AppStream  27 k
Enabling module streams:
 subversion              1.10

Transaction Summary
================================================================================
Install  8 Packages

Total download size: 3.0 M
Installed size: 11 M
Downloading Packages:
(1/8): apr-util-bdb-1.6.1-6.el8.x86_64.rpm      159 kB/s |  25 kB     00:00
(2/8): apr-1.6.3-9.el8.x86_64.rpm               580 kB/s | 125 kB     00:00
(3/8): apr-util-openssl-1.6.1-6.el8.x86_64.rpm  378 kB/s |  27 kB     00:00
(4/8): apr-util-1.6.1-6.el8.x86_64.rpm          451 kB/s | 105 kB     00:00
(5/8): libserf-1.3.9-8.module_el8.0.0+45+75bba4 661 kB/s |  60 kB     00:00
(6/8): utf8proc-2.1.1-4.module_el8.0.0+45+75bba 470 kB/s |  67 kB     00:00
(7/8): subversion-libs-1.10.2-1.module_el8.0.0+ 4.4 MB/s | 1.5 MB     00:00
(8/8): subversion-1.10.2-1.module_el8.0.0+45+75 1.2 MB/s | 1.1 MB     00:00
--------------------------------------------------------------------------------
Total                                           1.8 MB/s | 3.0 MB     00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Installing       : apr-1.6.3-9.el8.x86_64                                 1/8
  Running scriptlet: apr-1.6.3-9.el8.x86_64                                 1/8
  Installing       : apr-util-bdb-1.6.1-6.el8.x86_64                        2/8
  Installing       : apr-util-openssl-1.6.1-6.el8.x86_64                    3/8
  Installing       : apr-util-1.6.1-6.el8.x86_64                            4/8
  Running scriptlet: apr-util-1.6.1-6.el8.x86_64                            4/8
  Installing       : libserf-1.3.9-8.module_el8.0.0+45+75bba4f4.x86_64      5/8
  Running scriptlet: libserf-1.3.9-8.module_el8.0.0+45+75bba4f4.x86_64      5/8
  Installing       : utf8proc-2.1.1-4.module_el8.0.0+45+75bba4f4.x86_64     6/8
  Running scriptlet: utf8proc-2.1.1-4.module_el8.0.0+45+75bba4f4.x86_64     6/8
  Installing       : subversion-libs-1.10.2-1.module_el8.0.0+45+75bba4f4.   7/8
  Running scriptlet: subversion-libs-1.10.2-1.module_el8.0.0+45+75bba4f4.   7/8
  Installing       : subversion-1.10.2-1.module_el8.0.0+45+75bba4f4.x86_6   8/8
  Running scriptlet: subversion-1.10.2-1.module_el8.0.0+45+75bba4f4.x86_6   8/8
  Verifying        : apr-1.6.3-9.el8.x86_64                                 1/8
  Verifying        : apr-util-1.6.1-6.el8.x86_64                            2/8
  Verifying        : apr-util-bdb-1.6.1-6.el8.x86_64                        3/8
  Verifying        : apr-util-openssl-1.6.1-6.el8.x86_64                    4/8
  Verifying        : libserf-1.3.9-8.module_el8.0.0+45+75bba4f4.x86_64      5/8
  Verifying        : subversion-1.10.2-1.module_el8.0.0+45+75bba4f4.x86_6   6/8
  Verifying        : subversion-libs-1.10.2-1.module_el8.0.0+45+75bba4f4.   7/8
  Verifying        : utf8proc-2.1.1-4.module_el8.0.0+45+75bba4f4.x86_64     8/8

Installed:
  subversion-1.10.2-1.module_el8.0.0+45+75bba4f4.x86_64
  apr-util-bdb-1.6.1-6.el8.x86_64
  apr-util-openssl-1.6.1-6.el8.x86_64
  apr-1.6.3-9.el8.x86_64
  apr-util-1.6.1-6.el8.x86_64
  libserf-1.3.9-8.module_el8.0.0+45+75bba4f4.x86_64
  subversion-libs-1.10.2-1.module_el8.0.0+45+75bba4f4.x86_64
  utf8proc-2.1.1-4.module_el8.0.0+45+75bba4f4.x86_64

Complete!
Removing intermediate container 50105d860dc9
 ---> f2168e97f342
Step 3/6 : RUN yum install -y openssh-server && sed -i -e 's/#LoginGraceTime 2m/LoginGraceTime 2m/g' -e 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' -e 's/#StrictModes yes/StrictModes yes/g' /etc/ssh/sshd_config && mkdir /var/run/sshd && echo 'UseDNS no' >> /etc/ssh/sshd_config && sed -i -e '/pam_loginuid.so/d' /etc/pam.d/sshd && echo 'root:1qaz@WSX' | chpasswd && /usr/bin/ssh-keygen -A
 ---> Running in 6564c2a3ba47
Last metadata expiration check: 0:00:55 ago on Sun Apr 19 07:14:51 2020.
Dependencies resolved.
================================================================================
 Package               Architecture  Version                Repository     Size
================================================================================
Installing:
 openssh-server        x86_64        8.0p1-4.el8_1          BaseOS        485 k
Installing dependencies:
 fipscheck             x86_64        1.5.0-4.el8            BaseOS         28 k
 fipscheck-lib         x86_64        1.5.0-4.el8            BaseOS         16 k
 openssh               x86_64        8.0p1-4.el8_1          BaseOS        496 k

Transaction Summary
================================================================================
Install  4 Packages

Total download size: 1.0 M
Installed size: 3.6 M
Downloading Packages:
(1/4): fipscheck-lib-1.5.0-4.el8.x86_64.rpm      66 kB/s |  16 kB     00:00
(2/4): fipscheck-1.5.0-4.el8.x86_64.rpm         108 kB/s |  28 kB     00:00
(3/4): openssh-8.0p1-4.el8_1.x86_64.rpm         901 kB/s | 496 kB     00:00
(4/4): openssh-server-8.0p1-4.el8_1.x86_64.rpm  835 kB/s | 485 kB     00:00
--------------------------------------------------------------------------------
Total                                           793 kB/s | 1.0 MB     00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Installing       : fipscheck-lib-1.5.0-4.el8.x86_64                       1/4
  Running scriptlet: fipscheck-lib-1.5.0-4.el8.x86_64                       1/4
  Installing       : fipscheck-1.5.0-4.el8.x86_64                           2/4
  Running scriptlet: openssh-8.0p1-4.el8_1.x86_64                           3/4
  Installing       : openssh-8.0p1-4.el8_1.x86_64                           3/4
  Running scriptlet: openssh-server-8.0p1-4.el8_1.x86_64                    4/4
  Installing       : openssh-server-8.0p1-4.el8_1.x86_64                    4/4
  Running scriptlet: openssh-server-8.0p1-4.el8_1.x86_64                    4/4
  Verifying        : fipscheck-1.5.0-4.el8.x86_64                           1/4
  Verifying        : fipscheck-lib-1.5.0-4.el8.x86_64                       2/4
  Verifying        : openssh-8.0p1-4.el8_1.x86_64                           3/4
  Verifying        : openssh-server-8.0p1-4.el8_1.x86_64                    4/4

Installed:
  openssh-server-8.0p1-4.el8_1.x86_64        fipscheck-1.5.0-4.el8.x86_64
  fipscheck-lib-1.5.0-4.el8.x86_64           openssh-8.0p1-4.el8_1.x86_64

Complete!
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
Removing intermediate container 6564c2a3ba47
 ---> c8c82f4c6ce5
Step 4/6 : COPY init.sh /usr/svn/
 ---> 5ff7d71f6a5a
Step 5/6 : EXPOSE 3690
 ---> Running in 19907bfb9086
Removing intermediate container 19907bfb9086
 ---> 146f76ba27dd
Step 6/6 : CMD ["/bin/bash","/usr/svn/init.sh"]
 ---> Running in 6d0ea8f403c1
Removing intermediate container 6d0ea8f403c1
 ---> a90e7e80820d
Successfully built a90e7e80820d
Successfully tagged kevin/svnsrv:1.13.0
[root@Server dockerfile]# docker image ls -a
REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
<none>              <none>              146f76ba27dd        About a minute ago   437MB
kevin/svnsrv        1.13.0              a90e7e80820d        About a minute ago   437MB
<none>              <none>              c8c82f4c6ce5        About a minute ago   437MB
<none>              <none>              5ff7d71f6a5a        About a minute ago   437MB
<none>              <none>              f2168e97f342        2 minutes ago        402MB
centos              8.1.1911            470671670cac        3 months ago         237MB

3畏纲、運(yùn)行驗(yàn)證鏡像

[root@Server dockerfile]# docker container run -d --name "svnsrv01" -p 3690 kevin/svnsrv:1.13.0
[root@Server dockerfile]# docker container ls -a
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS                     NAMES
0c5d58816256        kevin/svnsrv:1.13.0   "/bin/bash /usr/svn/…"   13 seconds ago      Up 10 seconds       0.0.0.0:32778->3690/tcp   svnsrv01
[root@Server dockerfile]# svn co svn://192.168.28.8:32778/repository --username admin --password 1qaz@WSX

-----------------------------------------------------------------------
ATTENTION!  Your password for authentication realm:

   <svn://192.168.28.8:32778> repository

can only be stored to disk unencrypted!  You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible.  See the documentation for details.

You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/root/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? yes
Checked out revision 0.
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子芒篷,更是在濱河造成了極大的恐慌,老刑警劉巖采缚,帶你破解...
    沈念sama閱讀 211,265評(píng)論 6 490
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件针炉,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡仰担,警方通過查閱死者的電腦和手機(jī)糊识,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,078評(píng)論 2 385
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來摔蓝,“玉大人赂苗,你說我怎么就攤上這事≈荆” “怎么了拌滋?”我有些...
    開封第一講書人閱讀 156,852評(píng)論 0 347
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)猜谚。 經(jīng)常有香客問我败砂,道長(zhǎng),這世上最難降的妖魔是什么魏铅? 我笑而不...
    開封第一講書人閱讀 56,408評(píng)論 1 283
  • 正文 為了忘掉前任,我火速辦了婚禮览芳,結(jié)果婚禮上斜姥,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好铸敏,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,445評(píng)論 5 384
  • 文/花漫 我一把揭開白布缚忧。 她就那樣靜靜地躺著,像睡著了一般杈笔。 火紅的嫁衣襯著肌膚如雪闪水。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 49,772評(píng)論 1 290
  • 那天蒙具,我揣著相機(jī)與錄音球榆,去河邊找鬼。 笑死店量,一個(gè)胖子當(dāng)著我的面吹牛芜果,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播融师,決...
    沈念sama閱讀 38,921評(píng)論 3 406
  • 文/蒼蘭香墨 我猛地睜開眼右钾,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來了旱爆?” 一聲冷哼從身側(cè)響起舀射,我...
    開封第一講書人閱讀 37,688評(píng)論 0 266
  • 序言:老撾萬榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎怀伦,沒想到半個(gè)月后脆烟,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 44,130評(píng)論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡房待,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,467評(píng)論 2 325
  • 正文 我和宋清朗相戀三年邢羔,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片桑孩。...
    茶點(diǎn)故事閱讀 38,617評(píng)論 1 340
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡拜鹤,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出流椒,到底是詐尸還是另有隱情敏簿,我是刑警寧澤,帶...
    沈念sama閱讀 34,276評(píng)論 4 329
  • 正文 年R本政府宣布宣虾,位于F島的核電站惯裕,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏绣硝。R本人自食惡果不足惜蜻势,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,882評(píng)論 3 312
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望鹉胖。 院中可真熱鬧咙边,春花似錦猜煮、人聲如沸次员。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,740評(píng)論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽淑蔚。三九已至市殷,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間刹衫,已是汗流浹背醋寝。 一陣腳步聲響...
    開封第一講書人閱讀 31,967評(píng)論 1 265
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留带迟,地道東北人音羞。 一個(gè)月前我還...
    沈念sama閱讀 46,315評(píng)論 2 360
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像仓犬,于是被迫代替她去往敵國和親嗅绰。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,486評(píng)論 2 348

推薦閱讀更多精彩內(nèi)容