1、sudo -s
2、创建目录
mkdir -p /docker/sqlserver/mssql
3、进入目录
cd /docker/sqlserver
4、编辑docker-compose.yml
cat > /docker/sqlserver/docker-compose.yml <<END
version: '3'
services:
sqlserver:
image: "microsoft/mssql-server-linux:latest"
container_name: "sqlserver"
ports:
- "1433:1433"
volumes:
- "/docker/sqlserver/mssql:/var/opt/mssql"
- "/etc/localtime:/etc/localtime"
restart: always
environment:
#接受最终用户许可协议
- ACCEPT_EULA=Y
#SA用户密码
- SA_PASSWORD=!QAZ2wsx
END
5、启动
docker-compose up -d