1.运行这个命令
docker run -d -e SA_PASSWORD=Docker123 -e SQLSERVER_DATABASE=qgb -e SQLSERVER_USER=sa -e SQLSERVER_PASSWORD=MyDocker123 -p 1500:1433 exoplatform/sqlserver
docker run -d -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=MyDocker123' -p 1433:1433 -d mcr.microsoft.com/mssql/server:2017-latest
登录密码是 Docker123
------------------
docker pull nginx1.7.9
等价于:
docker pull docker.io/library/nginx1.7.9
------------------
打开SQL 管理工具
即可以链接。
可以对默认的数据库进行编辑
https://hub.docker.com/_/microsoft-mssql-server
https://docs.microsoft.com/zh-cn/sql/linux/quickstart-install-connect-docker?view=sql-server-ver15&pivots=cs1-bash
--------------------------------------
安装docker 之后,会创建一个network, 类似交换机吧。
root@iz2ze1ft89tfg58oe5csg7z ~]# ifconfig docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.17.0.1 netmask 255.255.0.0 broadcast 0.0.0.0 ether 02:42:e3:b7:18:7e txqueuelen 0 (Ethernet) RX packets 1074 bytes 70551 (68.8 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1453 bytes 651961 (636.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.19.66.169 netmask 255.255.240.0 broadcast 172.19.79.255 ether 00:16:3e:2e:4d:09 txqueuelen 1000 (Ethernet) RX packets 614194 bytes 845874052 (806.6 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 297462 bytes 24567675 (23.4 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 loop txqueuelen 1 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 veth3fe1dce: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 ether 92:95:e7:15:15:d2 txqueuelen 0 (Ethernet) RX packets 84 bytes 7433 (7.2 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 83 bytes 273172 (266.7 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
可以看到新pull 并运行的container 加入了这个网络
[root@iz2ze1ft89tfg58oe5csg7z ~]# docker network inspect bridge [ { "Name": "bridge", "Id": "ebb66d00eea3026436ddc916577a94853bc831f40339d8cd486efdc125538145", "Created": "2021-02-01T20:32:55.449049026+08:00", "Scope": "local", "Driver": "bridge", "EnableIPv6": false, "IPAM": { "Driver": "default", "Options": null, "Config": [ { "Subnet": "172.17.0.0/16" } ] }, "Internal": false, "Attachable": false, "Containers": { "b5e15257f9428e07c5818dbceff2107f03dd2dabe8cdc63e27cfb31e3273365a": { "Name": "quizzical_gates", "EndpointID": "c9e08b8e57a5b36b5fec61d84f14bd5cd394d82cf95d1d021c4ce07b06346f99", "MacAddress": "02:42:ac:11:00:02", "IPv4Address": "172.17.0.2/16", "IPv6Address": "" }