sudo docker pull mcr.microsoft.com/mssql/server:2022-latest
创建挂载文件夹
mkdir /data/sqlserver/data -p
给文件夹付权限
chmod 777 /data/sqlserver/data
sudo docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=123456" \
-p 1433:1433 --name sqlserver2022 --hostname sqlserver2022 \
-e "MSSQL_COLLATION=Chinese_PRC_CI_AS" \
-v /data/sqlserver/data:/var/opt/mssql/data \
-d \
--restart=always \
mcr.microsoft.com/mssql/server:2022-latest
-e "MSSQL_SA_PASSWORD=123456" #sa密码
-e "MSSQL_COLLATION=Chinese_PRC_CI_AS" #排序规则