[root@169_test mariadb10.3]# ll

总用量 8

-rw-r--r-- 1 root root 180 6月   6 10:25 Dockerfile

-rw-r--r-- 1 root root 173 6月   6 10:26 MariaDB.repo

[root@169_test mariadb10.3]# cat Dockerfile 

FROM centos

MAINTAINER kehl test

ADD MariaDB.repo /etc/yum.repos.d/MariaDB.repo

RUN yum install -y MariaDB-server

VOLUME ["/var/lib/mysql"]

EXPOSE 3306

CMD ["/usr/bin/mysqld_safe"]

[root@169_test mariadb10.3]# cat MariaDB.repo 

[mariadb]

name = MariaDB

baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/10.3/centos7-amd64/

gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB

gpgcheck=1

[root@169_test mariadb10.3]# 


测试过程如下:

[root@169_test mariadb10.3]# docker build -t mytest/mariadb10.3 .    

Sending build context to Docker daemon 3.072 kB

Step 1/7 : FROM centos

 ---> 9f38484d220f

Step 2/7 : MAINTAINER Jon Dell

 ---> Running in 2e22e1e204e9

 ---> 4a56cafc36ca

Removing intermediate container 2e22e1e204e9

Step 3/7 : ADD MariaDB.repo /etc/yum.repos.d/MariaDB.repo

 ---> 9874f163e60b

Removing intermediate container ff44c311f004

Step 4/7 : RUN yum install -y MariaDB-server

 ---> Running in 537761f38148


Loaded plugins: fastestmirror, ovl

Determining fastest mirrors

 * base: mirrors.nwsuaf.edu.cn

 * extras: mirrors.njupt.edu.cn

 * updates: mirrors.nwsuaf.edu.cn

http://mirrors.njupt.edu.cn/centos/7.6.1810/extras/x86_64/repodata/a43ebcbead3e693bb9e40cbeff682a0dd472019da58a6b4f7978f4830f5537ee-primary.sqlite.bz2: [Errno 14] HTTP Error 302 - Found

Trying other mirror.

Resolving Dependencies

--> Running transaction check

---> Package MariaDB-server.x86_64 0:10.3.15-1.el7.centos will be installed

--> Processing Dependency: rsync for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: perl(DBI) for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: perl(File::Path) for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: galera for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: perl(Sys::Hostname) for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: MariaDB-common for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: perl(POSIX) for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: perl(File::Temp) for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: MariaDB-client for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: /usr/bin/perl for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: perl(File::Basename) for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: perl(File::Copy) for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: lsof for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: perl(strict) for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: perl(Getopt::Long) for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: perl(Data::Dumper) for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: iproute for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: perl(vars) for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Processing Dependency: libaio.so.1()(64bit) for package: MariaDB-server-10.3.15-1.el7.centos.x86_64

--> Running transaction check

---> Package MariaDB-client.x86_64 0:10.3.15-1.el7.centos will be installed

--> Processing Dependency: perl(Exporter) for package: MariaDB-client-10.3.15-1.el7.centos.x86_64

---> Package MariaDB-common.x86_64 0:10.3.15-1.el7.centos will be installed

--> Processing Dependency: MariaDB-compat for package: MariaDB-common-10.3.15-1.el7.centos.x86_64

---> Package galera.x86_64 0:25.3.26-1.rhel7.el7.centos will be installed

--> Processing Dependency: openssl for package: galera-25.3.26-1.rhel7.el7.centos.x86_64

--> Processing Dependency: libboost_program_options.so.1.53.0()(64bit) for package: galera-25.3.26-1.rhel7.el7.centos.x86_64

---> Package iproute.x86_64 0:4.11.0-14.el7_6.2 will be installed

--> Processing Dependency: libmnl.so.0(LIBMNL_1.0)(64bit) for package: iproute-4.11.0-14.el7_6.2.x86_64

--> Processing Dependency: libxtables.so.10()(64bit) for package: iproute-4.11.0-14.el7_6.2.x86_64

--> Processing Dependency: libmnl.so.0()(64bit) for package: iproute-4.11.0-14.el7_6.2.x86_64

---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed

---> Package lsof.x86_64 0:4.87-6.el7 will be installed

---> Package perl.x86_64 4:5.16.3-294.el7_6 will be installed

--> Processing Dependency: perl-libs = 4:5.16.3-294.el7_6 for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(Socket) >= 1.3 for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(Scalar::Util) >= 1.10 for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl-macros for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl-libs for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(threads::shared) for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(threads) for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(constant) for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(Time::Local) for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(Time::HiRes) for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(Storable) for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(Socket) for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(Scalar::Util) for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(Pod::Simple::XHTML) for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(Pod::Simple::Search) for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(Filter::Util::Call) for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(File::Spec::Unix) for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(File::Spec::Functions) for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(File::Spec) for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(Cwd) for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: perl(Carp) for package: 4:perl-5.16.3-294.el7_6.x86_64

--> Processing Dependency: libperl.so()(64bit) for package: 4:perl-5.16.3-294.el7_6.x86_64

---> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed

--> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64

--> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64

---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed

---> Package perl-File-Path.noarch 0:2.09-2.el7 will be installed

---> Package perl-File-Temp.noarch 0:0.23.01-3.el7 will be installed

---> Package perl-Getopt-Long.noarch 0:2.40-3.el7 will be installed

--> Processing Dependency: perl(Pod::Usage) >= 1.14 for package: perl-Getopt-Long-2.40-3.el7.noarch

--> Processing Dependency: perl(Text::ParseWords) for package: perl-Getopt-Long-2.40-3.el7.noarch

---> Package rsync.x86_64 0:3.1.2-6.el7_6.1 will be installed

--> Running transaction check

---> Package MariaDB-compat.x86_64 0:10.3.15-1.el7.centos will be installed

---> Package boost-program-options.x86_64 0:1.53.0-27.el7 will be installed

---> Package iptables.x86_64 0:1.4.21-28.el7 will be installed

--> Processing Dependency: libnfnetlink.so.0()(64bit) for package: iptables-1.4.21-28.el7.x86_64

--> Processing Dependency: libnetfilter_conntrack.so.3()(64bit) for package: iptables-1.4.21-28.el7.x86_64

---> Package libmnl.x86_64 0:1.0.3-7.el7 will be installed

---> Package openssl.x86_64 1:1.0.2k-16.el7_6.1 will be installed

--> Processing Dependency: openssl-libs(x86-64) = 1:1.0.2k-16.el7_6.1 for package: 1:openssl-1.0.2k-16.el7_6.1.x86_64

--> Processing Dependency: make for package: 1:openssl-1.0.2k-16.el7_6.1.x86_64

---> Package perl-Carp.noarch 0:1.26-244.el7 will be installed

---> Package perl-Exporter.noarch 0:5.68-3.el7 will be installed

---> Package perl-Filter.x86_64 0:1.49-3.el7 will be installed

---> Package perl-PathTools.x86_64 0:3.40-5.el7 will be installed

---> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed

--> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch

--> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch

--> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch

--> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch

---> Package perl-Pod-Simple.noarch 1:3.28-4.el7 will be installed

--> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.28-4.el7.noarch

--> Processing Dependency: perl(Encode) for package: 1:perl-Pod-Simple-3.28-4.el7.noarch

---> Package perl-Pod-Usage.noarch 0:1.63-3.el7 will be installed

--> Processing Dependency: perl(Pod::Text) >= 3.15 for package: perl-Pod-Usage-1.63-3.el7.noarch

--> Processing Dependency: perl-Pod-Perldoc for package: perl-Pod-Usage-1.63-3.el7.noarch

---> Package perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 will be installed

---> Package perl-Socket.x86_64 0:2.010-4.el7 will be installed

---> Package perl-Storable.x86_64 0:2.45-3.el7 will be installed

---> Package perl-Text-ParseWords.noarch 0:3.29-4.el7 will be installed

---> Package perl-Time-HiRes.x86_64 4:1.9725-3.el7 will be installed

---> Package perl-Time-Local.noarch 0:1.2300-2.el7 will be installed

---> Package perl-constant.noarch 0:1.27-2.el7 will be installed

---> Package perl-libs.x86_64 4:5.16.3-294.el7_6 will be installed

---> Package perl-macros.x86_64 4:5.16.3-294.el7_6 will be installed

---> Package perl-threads.x86_64 0:1.87-4.el7 will be installed

---> Package perl-threads-shared.x86_64 0:1.43-6.el7 will be installed

--> Running transaction check

---> Package libnetfilter_conntrack.x86_64 0:1.0.6-1.el7_3 will be installed

---> Package libnfnetlink.x86_64 0:1.0.1-4.el7 will be installed

---> Package make.x86_64 1:3.82-23.el7 will be installed

---> Package openssl-libs.x86_64 1:1.0.2k-16.el7 will be updated

---> Package openssl-libs.x86_64 1:1.0.2k-16.el7_6.1 will be an update

---> Package perl-Encode.x86_64 0:2.51-7.el7 will be installed

---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed

--> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch

--> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch

---> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed

---> Package perl-Pod-Escapes.noarch 1:1.04-294.el7_6 will be installed

---> Package perl-Pod-Perldoc.noarch 0:3.20-4.el7 will be installed

--> Processing Dependency: perl(parent) for package: perl-Pod-Perldoc-3.20-4.el7.noarch

--> Processing Dependency: perl(HTTP::Tiny) for package: perl-Pod-Perldoc-3.20-4.el7.noarch

--> Processing Dependency: groff-base for package: perl-Pod-Perldoc-3.20-4.el7.noarch

---> Package perl-podlators.noarch 0:2.5.1-3.el7 will be installed

--> Running transaction check

---> Package groff-base.x86_64 0:1.22.2-8.el7 will be installed

---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed

---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed

---> Package perl-HTTP-Tiny.noarch 0:0.033-3.el7 will be installed

---> Package perl-parent.noarch 1:0.225-244.el7 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


================================================================================

 Package                  Arch    Version                        Repository

                                                                           Size

================================================================================

Installing:

 MariaDB-server           x86_64  10.3.15-1.el7.centos           mariadb   24 M

Installing for dependencies:

 MariaDB-client           x86_64  10.3.15-1.el7.centos           mariadb   11 M

 MariaDB-common           x86_64  10.3.15-1.el7.centos           mariadb   78 k

 MariaDB-compat           x86_64  10.3.15-1.el7.centos           mariadb  2.8 M

 boost-program-options    x86_64  1.53.0-27.el7                  base     156 k

 galera                   x86_64  25.3.26-1.rhel7.el7.centos     mariadb  8.1 M

 groff-base               x86_64  1.22.2-8.el7                   base     942 k

 iproute                  x86_64  4.11.0-14.el7_6.2              updates  764 k

 iptables                 x86_64  1.4.21-28.el7                  base     433 k

 libaio                   x86_64  0.3.109-13.el7                 base      24 k

 libmnl                   x86_64  1.0.3-7.el7                    base      23 k

 libnetfilter_conntrack   x86_64  1.0.6-1.el7_3                  base      55 k

 libnfnetlink             x86_64  1.0.1-4.el7                    base      26 k

 lsof                     x86_64  4.87-6.el7                     base     331 k

 make                     x86_64  1:3.82-23.el7                  base     420 k

 openssl                  x86_64  1:1.0.2k-16.el7_6.1            updates  493 k

 perl                     x86_64  4:5.16.3-294.el7_6             updates  8.0 M

 perl-Carp                noarch  1.26-244.el7                   base      19 k

 perl-Compress-Raw-Bzip2  x86_64  2.061-3.el7                    base      32 k

 perl-Compress-Raw-Zlib   x86_64  1:2.061-4.el7                  base      57 k

 perl-DBI                 x86_64  1.627-4.el7                    base     802 k

 perl-Data-Dumper         x86_64  2.145-3.el7                    base      47 k

 perl-Encode              x86_64  2.51-7.el7                     base     1.5 M

 perl-Exporter            noarch  5.68-3.el7                     base      28 k

 perl-File-Path           noarch  2.09-2.el7                     base      26 k

 perl-File-Temp           noarch  0.23.01-3.el7                  base      56 k

 perl-Filter              x86_64  1.49-3.el7                     base      76 k

 perl-Getopt-Long         noarch  2.40-3.el7                     base      56 k

 perl-HTTP-Tiny           noarch  0.033-3.el7                    base      38 k

 perl-IO-Compress         noarch  2.061-2.el7                    base     260 k

 perl-Net-Daemon          noarch  0.48-5.el7                     base      51 k

 perl-PathTools           x86_64  3.40-5.el7                     base      82 k

 perl-PlRPC               noarch  0.2020-14.el7                  base      36 k

 perl-Pod-Escapes         noarch  1:1.04-294.el7_6               updates   51 k

 perl-Pod-Perldoc         noarch  3.20-4.el7                     base      87 k

 perl-Pod-Simple          noarch  1:3.28-4.el7                   base     216 k

 perl-Pod-Usage           noarch  1.63-3.el7                     base      27 k

 perl-Scalar-List-Utils   x86_64  1.27-248.el7                   base      36 k

 perl-Socket              x86_64  2.010-4.el7                    base      49 k

 perl-Storable            x86_64  2.45-3.el7                     base      77 k

 perl-Text-ParseWords     noarch  3.29-4.el7                     base      14 k

 perl-Time-HiRes          x86_64  4:1.9725-3.el7                 base      45 k

 perl-Time-Local          noarch  1.2300-2.el7                   base      24 k

 perl-constant            noarch  1.27-2.el7                     base      19 k

 perl-libs                x86_64  4:5.16.3-294.el7_6             updates  688 k

 perl-macros              x86_64  4:5.16.3-294.el7_6             updates   44 k

 perl-parent              noarch  1:0.225-244.el7                base      12 k

 perl-podlators           noarch  2.5.1-3.el7                    base     112 k

 perl-threads             x86_64  1.87-4.el7                     base      49 k

 perl-threads-shared      x86_64  1.43-6.el7                     base      39 k

 rsync                    x86_64  3.1.2-6.el7_6.1                updates  404 k

Updating for dependencies:

 openssl-libs             x86_64  1:1.0.2k-16.el7_6.1            updates  1.2 M


Transaction Summary

================================================================================

Install  1 Package  (+50 Dependent packages)

Upgrade             (  1 Dependent package)


Total download size: 64 M

Downloading packages:

Delta RPMs disabled because /usr/bin/applydeltarpm not installed.

warning: /var/cache/yum/x86_64/7/mariadb/packages/MariaDB-client-10.3.15-1.el7.centos.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY

Public key for MariaDB-client-10.3.15-1.el7.centos.x86_64.rpm is not installed

warning: /var/cache/yum/x86_64/7/base/packages/boost-program-options-1.53.0-27.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY

Public key for boost-program-options-1.53.0-27.el7.x86_64.rpm is not installed

Public key for iproute-4.11.0-14.el7_6.2.x86_64.rpm is not installed

--------------------------------------------------------------------------------

Total                                              674 kB/s |  64 MB  01:37     

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

Importing GPG key 0xF4A80EB5:

 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"

 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5

 Package    : centos-release-7-6.1810.2.el7.centos.x86_64 (@CentOS)

 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

Retrieving key from https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB

Importing GPG key 0x1BB943DB:

 Userid     : "MariaDB Package Signing Key <package-signing-key@mariadb.org>"

 Fingerprint: 1993 69e5 404b d5fc 7d2f e43b cbcb 082a 1bb9 43db

 From       : https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Updating   : 1:openssl-libs-1.0.2k-16.el7_6.1.x86_64                     1/53 

  Installing : MariaDB-common-10.3.15-1.el7.centos.x86_64                  2/53 

  Installing : MariaDB-compat-10.3.15-1.el7.centos.x86_64                  3/53 

  Installing : libnfnetlink-1.0.1-4.el7.x86_64                             4/53 

  Installing : libaio-0.3.109-13.el7.x86_64                                5/53 

  Installing : libmnl-1.0.3-7.el7.x86_64                                   6/53 

  Installing : libnetfilter_conntrack-1.0.6-1.el7_3.x86_64                 7/53 

  Installing : iptables-1.4.21-28.el7.x86_64                               8/53 

  Installing : iproute-4.11.0-14.el7_6.2.x86_64                            9/53 

  Installing : 1:make-3.82-23.el7.x86_64                                  10/53 

  Installing : 1:openssl-1.0.2k-16.el7_6.1.x86_64                         11/53 

  Installing : boost-program-options-1.53.0-27.el7.x86_64                 12/53 

  Installing : galera-25.3.26-1.rhel7.el7.centos.x86_64                   13/53 

  Installing : groff-base-1.22.2-8.el7.x86_64                             14/53 

  Installing : 1:perl-parent-0.225-244.el7.noarch                         15/53 

  Installing : perl-HTTP-Tiny-0.033-3.el7.noarch                          16/53 

  Installing : perl-podlators-2.5.1-3.el7.noarch                          17/53 

  Installing : perl-Pod-Perldoc-3.20-4.el7.noarch                         18/53 

  Installing : 1:perl-Pod-Escapes-1.04-294.el7_6.noarch                   19/53 

  Installing : perl-Text-ParseWords-3.29-4.el7.noarch                     20/53 

  Installing : perl-Encode-2.51-7.el7.x86_64                              21/53 

  Installing : perl-Pod-Usage-1.63-3.el7.noarch                           22/53 

  Installing : 4:perl-libs-5.16.3-294.el7_6.x86_64                        23/53 

  Installing : 4:perl-macros-5.16.3-294.el7_6.x86_64                      24/53 

  Installing : 4:perl-Time-HiRes-1.9725-3.el7.x86_64                      25/53 

  Installing : perl-Exporter-5.68-3.el7.noarch                            26/53 

  Installing : perl-constant-1.27-2.el7.noarch                            27/53 

  Installing : perl-Time-Local-1.2300-2.el7.noarch                        28/53 

  Installing : perl-Socket-2.010-4.el7.x86_64                             29/53 

  Installing : perl-Carp-1.26-244.el7.noarch                              30/53 

  Installing : perl-Storable-2.45-3.el7.x86_64                            31/53 

  Installing : perl-PathTools-3.40-5.el7.x86_64                           32/53 

  Installing : perl-Scalar-List-Utils-1.27-248.el7.x86_64                 33/53 

  Installing : perl-File-Temp-0.23.01-3.el7.noarch                        34/53 

  Installing : perl-File-Path-2.09-2.el7.noarch                           35/53 

  Installing : perl-threads-shared-1.43-6.el7.x86_64                      36/53 

  Installing : perl-threads-1.87-4.el7.x86_64                             37/53 

  Installing : perl-Filter-1.49-3.el7.x86_64                              38/53 

  Installing : 1:perl-Pod-Simple-3.28-4.el7.noarch                        39/53 

  Installing : perl-Getopt-Long-2.40-3.el7.noarch                         40/53 

  Installing : 4:perl-5.16.3-294.el7_6.x86_64                             41/53 

  Installing : perl-Data-Dumper-2.145-3.el7.x86_64                        42/53 

  Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                 43/53 

  Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                44/53 

  Installing : perl-IO-Compress-2.061-2.el7.noarch                        45/53 

  Installing : perl-Net-Daemon-0.48-5.el7.noarch                          46/53 

  Installing : perl-PlRPC-0.2020-14.el7.noarch                            47/53 

  Installing : perl-DBI-1.627-4.el7.x86_64                                48/53 

  Installing : MariaDB-client-10.3.15-1.el7.centos.x86_64                 49/53 

  Installing : rsync-3.1.2-6.el7_6.1.x86_64                               50/53 

  Installing : lsof-4.87-6.el7.x86_64                                     51/53 

  Installing : MariaDB-server-10.3.15-1.el7.centos.x86_64                 52/53 

chown: invalid user: 'mysql'



PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !

To do so, start the server, then issue the following commands:


'/usr/bin/mysqladmin' -u root password 'new-password'

'/usr/bin/mysqladmin' -u root -h 2e22e1e204e9 password 'new-password'


Alternatively you can run:

'/usr/bin/mysql_secure_installation'


which will also give you the option of removing the test

databases and anonymous user created by default.  This is

strongly recommended for production servers.


See the MariaDB Knowledgebase at http://mariadb.com/kb or the

MySQL manual for more instructions.


Please report any problems at http://mariadb.org/jira


The latest information about MariaDB is available at http://mariadb.org/.

You can find additional information about the MySQL part at:

http://dev.mysql.com

Consider joining MariaDB's strong and vibrant community:

https://mariadb.org/get-involved/


  Cleanup    : 1:openssl-libs-1.0.2k-16.el7.x86_64                        53/53 

  Verifying  : perl-HTTP-Tiny-0.033-3.el7.noarch                           1/53 

  Verifying  : libmnl-1.0.3-7.el7.x86_64                                   2/53 

  Verifying  : MariaDB-server-10.3.15-1.el7.centos.x86_64                  3/53 

  Verifying  : iproute-4.11.0-14.el7_6.2.x86_64                            4/53 

  Verifying  : perl-threads-shared-1.43-6.el7.x86_64                       5/53 

  Verifying  : 4:perl-Time-HiRes-1.9725-3.el7.x86_64                       6/53 

  Verifying  : 1:perl-Pod-Escapes-1.04-294.el7_6.noarch                    7/53 

  Verifying  : lsof-4.87-6.el7.x86_64                                      8/53 

  Verifying  : perl-Exporter-5.68-3.el7.noarch                             9/53 

  Verifying  : perl-constant-1.27-2.el7.noarch                            10/53 

  Verifying  : perl-PathTools-3.40-5.el7.x86_64                           11/53 

  Verifying  : libnetfilter_conntrack-1.0.6-1.el7_3.x86_64                12/53 

  Verifying  : galera-25.3.26-1.rhel7.el7.centos.x86_64                   13/53 

  Verifying  : rsync-3.1.2-6.el7_6.1.x86_64                               14/53 

  Verifying  : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                 15/53 

  Verifying  : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                16/53 

  Verifying  : 1:perl-parent-0.225-244.el7.noarch                         17/53 

  Verifying  : 4:perl-5.16.3-294.el7_6.x86_64                             18/53 

  Verifying  : perl-Net-Daemon-0.48-5.el7.noarch                          19/53 

  Verifying  : 4:perl-libs-5.16.3-294.el7_6.x86_64                        20/53 

  Verifying  : groff-base-1.22.2-8.el7.x86_64                             21/53 

  Verifying  : perl-File-Temp-0.23.01-3.el7.noarch                        22/53 

  Verifying  : 1:perl-Pod-Simple-3.28-4.el7.noarch                        23/53 

  Verifying  : MariaDB-client-10.3.15-1.el7.centos.x86_64                 24/53 

  Verifying  : perl-Time-Local-1.2300-2.el7.noarch                        25/53 

  Verifying  : boost-program-options-1.53.0-27.el7.x86_64                 26/53 

  Verifying  : perl-DBI-1.627-4.el7.x86_64                                27/53 

  Verifying  : libaio-0.3.109-13.el7.x86_64                               28/53 

  Verifying  : 4:perl-macros-5.16.3-294.el7_6.x86_64                      29/53 

  Verifying  : perl-Socket-2.010-4.el7.x86_64                             30/53 

  Verifying  : 1:openssl-1.0.2k-16.el7_6.1.x86_64                         31/53 

  Verifying  : perl-Carp-1.26-244.el7.noarch                              32/53 

  Verifying  : perl-Data-Dumper-2.145-3.el7.x86_64                        33/53 

  Verifying  : perl-Storable-2.45-3.el7.x86_64                            34/53 

  Verifying  : perl-Scalar-List-Utils-1.27-248.el7.x86_64                 35/53 

  Verifying  : 1:openssl-libs-1.0.2k-16.el7_6.1.x86_64                    36/53 

  Verifying  : perl-IO-Compress-2.061-2.el7.noarch                        37/53 

  Verifying  : perl-Pod-Usage-1.63-3.el7.noarch                           38/53 

  Verifying  : perl-PlRPC-0.2020-14.el7.noarch                            39/53 

  Verifying  : iptables-1.4.21-28.el7.x86_64                              40/53 

  Verifying  : perl-Encode-2.51-7.el7.x86_64                              41/53 

  Verifying  : libnfnetlink-1.0.1-4.el7.x86_64                            42/53 

  Verifying  : perl-Pod-Perldoc-3.20-4.el7.noarch                         43/53 

  Verifying  : perl-podlators-2.5.1-3.el7.noarch                          44/53 

  Verifying  : perl-File-Path-2.09-2.el7.noarch                           45/53 

  Verifying  : perl-threads-1.87-4.el7.x86_64                             46/53 

  Verifying  : perl-Filter-1.49-3.el7.x86_64                              47/53 

  Verifying  : perl-Getopt-Long-2.40-3.el7.noarch                         48/53 

  Verifying  : perl-Text-ParseWords-3.29-4.el7.noarch                     49/53 

  Verifying  : MariaDB-common-10.3.15-1.el7.centos.x86_64                 50/53 

  Verifying  : 1:make-3.82-23.el7.x86_64                                  51/53 

  Verifying  : MariaDB-compat-10.3.15-1.el7.centos.x86_64                 52/53 

  Verifying  : 1:openssl-libs-1.0.2k-16.el7.x86_64                        53/53 


Installed:

  MariaDB-server.x86_64 0:10.3.15-1.el7.centos                                  


Dependency Installed:

  MariaDB-client.x86_64 0:10.3.15-1.el7.centos                                  

  MariaDB-common.x86_64 0:10.3.15-1.el7.centos                                  

  MariaDB-compat.x86_64 0:10.3.15-1.el7.centos                                  

  boost-program-options.x86_64 0:1.53.0-27.el7                                  

  galera.x86_64 0:25.3.26-1.rhel7.el7.centos                                    

  groff-base.x86_64 0:1.22.2-8.el7                                              

  iproute.x86_64 0:4.11.0-14.el7_6.2                                            

  iptables.x86_64 0:1.4.21-28.el7                                               

  libaio.x86_64 0:0.3.109-13.el7                                                

  libmnl.x86_64 0:1.0.3-7.el7                                                   

  libnetfilter_conntrack.x86_64 0:1.0.6-1.el7_3                                 

  libnfnetlink.x86_64 0:1.0.1-4.el7                                             

  lsof.x86_64 0:4.87-6.el7                                                      

  make.x86_64 1:3.82-23.el7                                                     

  openssl.x86_64 1:1.0.2k-16.el7_6.1                                            

  perl.x86_64 4:5.16.3-294.el7_6                                                

  perl-Carp.noarch 0:1.26-244.el7                                               

  perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7                                  

  perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7                                   

  perl-DBI.x86_64 0:1.627-4.el7                                                 

  perl-Data-Dumper.x86_64 0:2.145-3.el7                                         

  perl-Encode.x86_64 0:2.51-7.el7                                               

  perl-Exporter.noarch 0:5.68-3.el7                                             

  perl-File-Path.noarch 0:2.09-2.el7                                            

  perl-File-Temp.noarch 0:0.23.01-3.el7                                         

  perl-Filter.x86_64 0:1.49-3.el7                                               

  perl-Getopt-Long.noarch 0:2.40-3.el7                                          

  perl-HTTP-Tiny.noarch 0:0.033-3.el7                                           

  perl-IO-Compress.noarch 0:2.061-2.el7                                         

  perl-Net-Daemon.noarch 0:0.48-5.el7                                           

  perl-PathTools.x86_64 0:3.40-5.el7                                            

  perl-PlRPC.noarch 0:0.2020-14.el7                                             

  perl-Pod-Escapes.noarch 1:1.04-294.el7_6                                      

  perl-Pod-Perldoc.noarch 0:3.20-4.el7                                          

  perl-Pod-Simple.noarch 1:3.28-4.el7                                           

  perl-Pod-Usage.noarch 0:1.63-3.el7                                            

  perl-Scalar-List-Utils.x86_64 0:1.27-248.el7                                  

  perl-Socket.x86_64 0:2.010-4.el7                                              

  perl-Storable.x86_64 0:2.45-3.el7                                             

  perl-Text-ParseWords.noarch 0:3.29-4.el7                                      

  perl-Time-HiRes.x86_64 4:1.9725-3.el7                                         

  perl-Time-Local.noarch 0:1.2300-2.el7                                         

  perl-constant.noarch 0:1.27-2.el7                                             

  perl-libs.x86_64 4:5.16.3-294.el7_6                                           

  perl-macros.x86_64 4:5.16.3-294.el7_6                                         

  perl-parent.noarch 1:0.225-244.el7                                            

  perl-podlators.noarch 0:2.5.1-3.el7                                           

  perl-threads.x86_64 0:1.87-4.el7                                              

  perl-threads-shared.x86_64 0:1.43-6.el7                                       

  rsync.x86_64 0:3.1.2-6.el7_6.1                                                


Dependency Updated:

  openssl-libs.x86_64 1:1.0.2k-16.el7_6.1                                       


Complete!

 ---> f897e8b66681

Removing intermediate container 537761f38148

Step 5/7 : VOLUME /var/lib/mysql

 ---> Running in c74a1b1728be

 ---> 419f6afca8a8

Removing intermediate container c74a1b1728be

Step 6/7 : EXPOSE 3306

 ---> Running in 572da7392255

 ---> dfd1149acd5a

Removing intermediate container 572da7392255

Step 7/7 : CMD /usr/bin/mysqld_safe

 ---> Running in f3ad1ab392a5

 ---> 9e154ea001f9

Removing intermediate container f3ad1ab392a5

Successfully built 9e154ea001f9

[root@169_test mariadb10.3]# docker images 

REPOSITORY                                            TAG                 IMAGE ID            CREATED             SIZE

mytest/mariadb10.3                                    latest              9e154ea001f9        45 seconds ago      697 MB

docker.io/pingcap/tikv                                latest              d9a9c6e9a26e        8 days ago          317 MB

docker.io/pingcap/tidb                                latest              711d0a94d965        8 days ago          78.8 MB

docker.io/blacktop/elasticsearch                      latest              32e8ce7a798c        13 days ago         661 MB

docker.io/pingcap/pd                                  latest              f6357deab167        4 weeks ago         79.4 MB

docker.io/pingcap/tispark                             latest              0cac838c0912        5 weeks ago         863 MB

docker.io/centos                                      latest              9f38484d220f        2 months ago        202 MB

docker.io/grafana/grafana                             6.0.1               ffd9c905f698        3 months ago        241 MB

docker.io/siriuszg/kubernetes-dashboard-amd64         latest              e7c4c6156216        5 months ago        122 MB

docker.io/k8scn/kubernetes-dashboard-amd64            latest              1b604d831cb5        12 months ago       102 MB

docker.io/pingcap/tidb-vision                         latest              e9b25d9f7bdb        13 months ago       47.6 MB

docker.io/prom/prometheus                             v2.2.1              cc866859f8df        14 months ago       113 MB

registry.access.redhat.com/rhel7/pod-infrastructure   latest              99965fb98423        19 months ago       209 MB

docker.io/prom/pushgateway                            v0.3.1              434efa6ed9db        2 years ago         13.3 MB

[root@169_test mariadb10.3]# docker run -d -p 3306:3306 --name mariadb mytest/mariadb10.3       

7c46313f6bb9ff612df51072a937a77aa85ecde43540857065b8c890c55afc46

[root@169_test mariadb10.3]# docker ps 

CONTAINER ID        IMAGE                                     COMMAND                  CREATED             STATUS              PORTS                                               NAMES

7c46313f6bb9        mytest/mariadb10.3                        "/usr/bin/mysqld_safe"   7 seconds ago       Up 5 seconds        0.0.0.0:3306->3306/tcp                              mariadb

b66f74532117        docker.io/blacktop/elasticsearch:latest   "/elastic-entrypoi..."   7 days ago          Up 7 days           0.0.0.0:9200->9200/tcp, 9300/tcp                    es01

62948fe07f2d        pingcap/tispark:latest                    "/opt/spark/sbin/s..."   7 days ago          Up 7 days           0.0.0.0:38081->38081/tcp                            tidbdockercompose_tispark-slave0_1

69ed3cfc1ad9        pingcap/tidb:latest                       "/tidb-server --st..."   7 days ago          Up 7 days           0.0.0.0:4000->4000/tcp, 0.0.0.0:10080->10080/tcp    tidbdockercompose_tidb_1

529db14f7c5d        pingcap/tispark:latest                    "/opt/spark/sbin/s..."   7 days ago          Up 7 days           0.0.0.0:7077->7077/tcp, 0.0.0.0:8080->8080/tcp      tidbdockercompose_tispark-master_1

fafcc79f673d        pingcap/tikv:latest                       "/tikv-server --ad..."   7 days ago          Up 7 days           20160/tcp                                           tidbdockercompose_tikv1_1

c3420b8e0b80        pingcap/tikv:latest                       "/tikv-server --ad..."   7 days ago          Up 7 days           20160/tcp                                           tidbdockercompose_tikv2_1

816952e4b30a        pingcap/tikv:latest                       "/tikv-server --ad..."   7 days ago          Up 7 days           20160/tcp                                           tidbdockercompose_tikv0_1

2f9558e04db0        pingcap/tidb-vision:latest                "/bin/sh -c 'sed -..."   7 days ago          Up 7 days           80/tcp, 443/tcp, 2015/tcp, 0.0.0.0:8010->8010/tcp   tidbdockercompose_tidb-vision_1

3b6cc4b47119        pingcap/pd:latest                         "/pd-server --name..."   7 days ago          Up 7 days           2380/tcp, 0.0.0.0:1026->2379/tcp                    tidbdockercompose_pd1_1

4e8bd9e07b44        pingcap/pd:latest                         "/pd-server --name..."   7 days ago          Up 7 days           2380/tcp, 0.0.0.0:1025->2379/tcp                    tidbdockercompose_pd0_1

2434615c5d70        prom/prometheus:v2.2.1                    "/bin/prometheus -..."   7 days ago          Up 7 days           0.0.0.0:9090->9090/tcp                              tidbdockercompose_prometheus_1

e4a0e4ae0ec9        pingcap/pd:latest                         "/pd-server --name..."   7 days ago          Up 7 days           2380/tcp, 0.0.0.0:1024->2379/tcp                    tidbdockercompose_pd2_1

76a781f0820e        grafana/grafana:6.0.1                     "/run.sh"                7 days ago          Up 7 days           0.0.0.0:3000->3000/tcp                              tidbdockercompose_grafana_1

bf7d401a5ac2        prom/pushgateway:v0.3.1                   "/bin/pushgateway ..."   7 days ago          Up 7 days           9091/tcp                                            tidbdockercompose_pushgateway_1

[root@169_test mariadb10.3]# mysql 

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

[root@169_test mariadb10.3]# mysql  -h127.0.0.1

ERROR 1130 (HY000): Host 'gateway' is not allowed to connect to this MariaDB server

[root@169_test mariadb10.3]# mysql  -h127.0.0.1 -uroot 

ERROR 1130 (HY000): Host 'gateway' is not allowed to connect to this MariaDB server

[root@169_test mariadb10.3]# mysql  -h127.0.0.1 -uroot -P3306 

ERROR 1130 (HY000): Host 'gateway' is not allowed to connect to this MariaDB server

[root@169_test mariadb10.3]# docker ps -a

CONTAINER ID        IMAGE                                     COMMAND                  CREATED              STATUS              PORTS                                               NAMES

7c46313f6bb9        mytest/mariadb10.3                        "/usr/bin/mysqld_safe"   About a minute ago   Up About a minute   0.0.0.0:3306->3306/tcp                              mariadb

b66f74532117        docker.io/blacktop/elasticsearch:latest   "/elastic-entrypoi..."   7 days ago           Up 7 days           0.0.0.0:9200->9200/tcp, 9300/tcp                    es01

62948fe07f2d        pingcap/tispark:latest                    "/opt/spark/sbin/s..."   7 days ago           Up 7 days           0.0.0.0:38081->38081/tcp                            tidbdockercompose_tispark-slave0_1

69ed3cfc1ad9        pingcap/tidb:latest                       "/tidb-server --st..."   7 days ago           Up 7 days           0.0.0.0:4000->4000/tcp, 0.0.0.0:10080->10080/tcp    tidbdockercompose_tidb_1

529db14f7c5d        pingcap/tispark:latest                    "/opt/spark/sbin/s..."   7 days ago           Up 7 days           0.0.0.0:7077->7077/tcp, 0.0.0.0:8080->8080/tcp      tidbdockercompose_tispark-master_1

fafcc79f673d        pingcap/tikv:latest                       "/tikv-server --ad..."   7 days ago           Up 7 days           20160/tcp                                           tidbdockercompose_tikv1_1

c3420b8e0b80        pingcap/tikv:latest                       "/tikv-server --ad..."   7 days ago           Up 7 days           20160/tcp                                           tidbdockercompose_tikv2_1

816952e4b30a        pingcap/tikv:latest                       "/tikv-server --ad..."   7 days ago           Up 7 days           20160/tcp                                           tidbdockercompose_tikv0_1

2f9558e04db0        pingcap/tidb-vision:latest                "/bin/sh -c 'sed -..."   7 days ago           Up 7 days           80/tcp, 443/tcp, 2015/tcp, 0.0.0.0:8010->8010/tcp   tidbdockercompose_tidb-vision_1

3b6cc4b47119        pingcap/pd:latest                         "/pd-server --name..."   7 days ago           Up 7 days           2380/tcp, 0.0.0.0:1026->2379/tcp                    tidbdockercompose_pd1_1

4e8bd9e07b44        pingcap/pd:latest                         "/pd-server --name..."   7 days ago           Up 7 days           2380/tcp, 0.0.0.0:1025->2379/tcp                    tidbdockercompose_pd0_1

2434615c5d70        prom/prometheus:v2.2.1                    "/bin/prometheus -..."   7 days ago           Up 7 days           0.0.0.0:9090->9090/tcp                              tidbdockercompose_prometheus_1

e4a0e4ae0ec9        pingcap/pd:latest                         "/pd-server --name..."   7 days ago           Up 7 days           2380/tcp, 0.0.0.0:1024->2379/tcp                    tidbdockercompose_pd2_1

76a781f0820e        grafana/grafana:6.0.1                     "/run.sh"                7 days ago           Up 7 days           0.0.0.0:3000->3000/tcp                              tidbdockercompose_grafana_1

bf7d401a5ac2        prom/pushgateway:v0.3.1                   "/bin/pushgateway ..."   7 days ago           Up 7 days           9091/tcp                                            tidbdockercompose_pushgateway_1

[root@169_test mariadb10.3]# docker exec -it 7c4 bash

[root@7c46313f6bb9 /]# mysql

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MariaDB connection id is 11

Server version: 10.3.15-MariaDB MariaDB Server


Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


MariaDB [(none)]> select * from user;

ERROR 1046 (3D000): No database selected

MariaDB [(none)]> select host,user from mysql.user;      

+--------------+------+

| host         | user |

+--------------+------+

| 127.0.0.1    | root |

| 2e22e1e204e9 |      |

| 2e22e1e204e9 | root |

| ::1          | root |

| localhost    |      |

| localhost    | root |

+--------------+------+

6 rows in set (0.002 sec)


MariaDB [(none)]> update user set host='%' where host='::1';

ERROR 1046 (3D000): No database selected

MariaDB [(none)]> update mysql.user set host='%' where host='::1';

Query OK, 1 row affected (0.002 sec)

Rows matched: 1  Changed: 1  Warnings: 0


MariaDB [(none)]> flush privileges;

Query OK, 0 rows affected (0.001 sec)


MariaDB [(none)]> exit

Bye

[root@7c46313f6bb9 /]# exit

exit

[root@169_test mariadb10.3]# mysql  -h127.0.0.1 -uroot -P3306 

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 12

Server version: 5.5.5-10.3.15-MariaDB MariaDB Server


Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.


Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> exit

Bye