### 安装相关依赖
[root@VM_0_5_centos ~]# yum update
[root@VM_0_5_centos ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Package yum-utils-1.1.31-52.el7.noarch already installed and latest version
Package device-mapper-persistent-data-0.8.5-1.el7.x86_64 already installed and latest version
Package 7:lvm2-2.02.185-2.el7_7.2.x86_64 already installed and latest version
Nothing to do
### 设置yum源
[root@VM_0_5_centos ~]# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Loaded plugins: fastestmirror, langpacks
adding repo from: http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
grabbing file http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
### 查看所有仓库中所有docker版本
[root@VM_0_5_centos ~]# yum list docker-ce --showduplicates | sort -r
Loading mirror speeds from cached hostfile
Loaded plugins: fastestmirror, langpacks
Installed Packages
docker-ce.x86_64 3:19.03.5-3.el7 docker-ce-stable
docker-ce.x86_64 3:19.03.4-3.el7 docker-ce-stable
docker-ce.x86_64 3:19.03.3-3.el7 docker-ce-stable
docker-ce.x86_64 3:19.03.2-3.el7 docker-ce-stable
docker-ce.x86_64 3:19.03.1-3.el7 docker-ce-stable
docker-ce.x86_64 3:19.03.0-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.9-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.8-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.7-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.6-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.5-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.4-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.3-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.2-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.1-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.0-3.el7 docker-ce-stable
docker-ce.x86_64 18.06.3.ce-3.el7 docker-ce-stable
docker-ce.x86_64 18.06.3.ce-3.el7 @docker-ce-stable
docker-ce.x86_64 18.06.2.ce-3.el7 docker-ce-stable
docker-ce.x86_64 18.06.1.ce-3.el7 docker-ce-stable
docker-ce.x86_64 18.06.0.ce-3.el7 docker-ce-stable
docker-ce.x86_64 18.03.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 18.03.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.12.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.12.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.09.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.09.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.2.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.3.ce-1.el7 docker-ce-stable
docker-ce.x86_64 17.03.2.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.0.ce-1.el7.centos docker-ce-stable
Available Packages
### 选择特定版本安装
[root@VM_0_5_centos ~]# yum install docker-ce-18.06.3.ce-3.el7
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Package docker-ce-18.06.3.ce-3.el7.x86_64 already installed and latest version
Nothing to do
### 运行Docker,并加入开机启动
[root@VM_0_5_centos ~]# systemctl start docker
[root@VM_0_5_centos ~]# systemctl enable docker
[root@VM_0_5_centos ~]# docker search mssql
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
microsoft/mssql-server-linux Deprecated SQL Server on Linux Container Rep… 1160
microsoft/mssql-server-windows-developer Official Microsoft SQL Server Developer Edit… 371
microsoft/mssql-server-windows-express Official Microsoft SQL Server Express Editio… 333
microsoft/mssql-tools Official images for Microsoft SQL Server Com… 51
rsmoorthy/mssql MSSQL Database (version SQL2000) 12 [OK]
datagrip/mssql-server-linux SQL Server and SQL Server tools on Linux(201… 9 [OK]
gantrior/mssql-server-2014-express-windows-with-iis mssql 2014 + IIS 4
microsoft/mssql-monitoring-influxdb Sample Image for Influxdb, This image is des… 3
mcmoe/mssqldocker Builds on microsoft/mssql-server-linux and a… 3 [OK]
tsgkadot/mssql-tools SQL Server tools on Linux (sqlcmd) 3 [OK]
ansibleplaybookbundle/mssql-apb MS SQL Server on Linux (APB) 2 [OK]
jboesl/mssql-server-linux mssql-server-linux with mssql-tools installe… 2 [OK]
bitwarden/mssql The Bitwarden database. 2
militellovinx/mssql-server-linux microsoft/mssql-server-linux with mssql-tool… 2 [OK]
ansibleplaybookbundle/mssql-remote-apb An APB that deploys Microsoft SQL Server 1 [OK]
microsoft/mssql-monitoring-collectd This Sample image is designed to work with t… 1
metaskills/mssql-server-linux-rails Microsoft SQL Server for Linux - Rails Adapt… 1
dhwanilraval/mssql-docker-rhel-official SQL Server in Docker 1 [OK]
christianacca/mssql-server-windows-express Fork of official microsoft/mssql-server-wind… 0
softwareplant/mssql SQL Server test database 0 [OK]
uwthalesians/mssql Mssql Database Server for Perceptia 0
plever/mssql-server-linux-plus Adding additional tooling to the base sql se… 0
liaisonintl/mssql-server-linux mssql-server-linux 0 [OK]
tchughesiv/mssql-server-linux CentOS build 0 [OK]
astronomerio/mssql-source
[root@VM_0_5_centos ~]# docker pull microsoft/mssql-server-linux
Using default tag: latest
latest: Pulling from microsoft/mssql-server-linux
59ab41dd721a: Pull complete
57da90bec92c: Pull complete
06fe57530625: Pull complete
5a6315cba1ff: Pull complete
739f58768b3f: Pull complete
0b751601bca3: Pull complete
bcf04a22644a: Pull complete
6b5009e4f470: Pull complete
a9dca2f6722a: Pull complete
Digest: sha256:9b700672670bb3db4b212e8aef841ca79eb2fce7d5975a5ce35b7129a9b90ec0
Status: Downloaded newer image for microsoft/mssql-server-linux:latest
[root@VM_0_5_centos ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
microsoft/mssql-server-linux latest 314918ddaedf 11 months ago 1.35GB
[root@VM_0_5_centos ~]# sudo docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=' -p 1433:1433 -v :/var/opt/mssql --name mssql-latest -d microsoft/mssql-server-linux
35a8b53a0d8214f4093bf94dc63e733315778c5fff1f79e30e722552a2548cb3
### 1433:1433 前者主机端口 后者docker虚拟机端口