在之前的博客我们看了mac 平台docker 安装达梦数据库,如下:
Mac 安装 Homebrew 操作示例
https://www.cndba.cn/dave/article/116428Mac 安装 Docker 并修改源
https://www.cndba.cn/dave/article/116440Mac 平台 Docker 安装 DM达梦数据库
https://www.cndba.cn/dave/article/116442
本篇我们看下SQLServer的安装。
1 拉取docker 镜像
david@Lotus ~ % docker pull mcr.microsoft.com/azure-sql-edge
Using default tag: latest
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
david@Lotus ~ % docker pull mcr.microsoft.com/azure-sql-edge
Using default tag: latest
latest: Pulling from azure-sql-edge
c58359f0ed07: Pull complete
f9c126982b5c: Pull complete
589ba23f4d73: Pull complete
0c037bc6ac64: Pull complete
ce1f004ff642: Pull complete
4e0b1d630a9d: Pull complete
cf712679c0f8: Pull complete
7f5ed2ab3c5b: Pull complete
56e4c7793de3: Pull complete
89f8b7dcee44: Pull complete
82fa393cf611: Pull complete
Digest: sha256:1dcc88d2d9e555d0addb0636648d0da033206978d7c5c4da044c904a0f06f58b
Status: Downloaded newer image for mcr.microsoft.com/azure-sql-edge:latest
mcr.microsoft.com/azure-sql-edge:latest
david@Lotus ~ %
david@Lotus ~ % docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mcr.microsoft.com/azure-sql-edge latest 9d0e27694fc9 2 weeks ago 1.84GB
dm8_single v8.1.2.128_ent_x86_64_ctm_pack4 ccb727ce9dce 6 months ago 432MB
david@Lotus ~ %
2 创建SQLServer容器
david@Lotus ~ % docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=dave@cndba" -p 1433:1433 --name sqlserver -d mcr.microsoft.com/azure-sql-edge
e89953026bbca3fbfeca8e39a4e118a840927cea793ba7894af045692a91695a
david@Lotus ~ % docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e89953026bbc mcr.microsoft.com/azure-sql-edge "/opt/mssql/bin/perm…" 9 seconds ago Up 8 seconds 1401/tcp, 0.0.0.0:1433->1433/tcp sqlserver
b608c67d6f5a dm8_single:v8.1.2.128_ent_x86_64_ctm_pack4 "/bin/bash /opt/star…" 7 days ago Exited (137) 6 days ago dm8
david@Lotus ~ %
david@Lotus ~ % docker exec -it sqlserver bash
mssql@e89953026bbc:/$ cd opt
mssql@e89953026bbc:/opt$ ls
microsoft mssql mssql-extensibility
3 连接
mac上直接使用dbeaver 连接就访问了。
DBeaver 工具说明
https://www.cndba.cn/dave/article/22830
当然,SQLServer 比较好用的就是SMSS工具,这个MAC 就不支持了,只能从其他windows的机器上连接。
版权声明:本文为博主原创文章,未经博主允许不得转载。