Docker 中的 SQL Server 2019:您可以通过指定 --accept-eula 命令行选项来接受 EULA

nhu*_*uvy 12 sql-server docker

命令

docker pull mcr.microsoft.com/mssql/server:2019-latest

docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=123456a@' -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest

docker logs -f 1b2ce04432883df593535157999ae3d2996620155b71e0e1d9fd25e8b2e60628
Run Code Online (Sandbox Code Playgroud)

文档: https: //hub.docker.com/_/microsoft-mssql-server

在此输入图像描述

在此输入图像描述

在此输入图像描述

我看到我的错误

SQL Server 2019 will run as non-root by default.

This container is running as user mssql.

To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.

The SQL Server End-User License Agreement (EULA) must be accepted before SQL

Server can start. The license terms for this product can be downloaded from

http://go.microsoft.com/fwlink/?LinkId=746388.


You can accept the EULA by specifying the --accept-eula command line option,

setting the ACCEPT_EULA environment variable, or using the mssql-conf tool.

SQL Server 2019 will run as non-root by default.

This container is running as user mssql.

To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.

The SQL Server End-User License Agreement (EULA) must be accepted before SQL

Server can start. The license terms for this product can be downloaded from

http://go.microsoft.com/fwlink/?LinkId=746388.


You can accept the EULA by specifying the --accept-eula command line option,

setting the ACCEPT_EULA environment variable, or using the mssql-conf tool.
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

在此输入图像描述

在此输入图像描述

nhu*_*uvy 25

这是参考文档中的错误(位于https://hub.docker.com/_/microsoft-mssql-server)。

在此输入图像描述

修理它

使用" ",不使用' '

docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=123456a@" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest
Run Code Online (Sandbox Code Playgroud)

另一份参考文档:https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker ?view=sql-server-ver15&pivots=cs1-bash#pullandrun2019

查看更多信息https://github.com/microsoft/mssql-docker/issues/199#issuecomment-346092077

  • 天哪,答案是使用双引号!!!!感谢您提出您的解决方案。这是一个非常简单的错误,我几乎要费尽心思去解决这个问题。 (2认同)