我正在 nopCommerce 上处理一个项目,并尝试使用 docker 映像运行它。有两个映像,一个用于 nopCommerce,第二个用于 MSSQL 服务器。这是我遵循的步骤,
1)构建docker镜像并在端口8080上运行
C:\Users\Admin>docker run -d -p 8080:80 --name mystore nop420 ca626cc5ed4e3759a03e9645dcd374016a5d8f278ffede8e1345f851f9a82c7d
项目运行在8080端口
2) 从Docker Hub中提取 MSSQL(Express) Linux 镜像
3)使用命令运行它
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=yourStrong(!)Password' -e 'MSSQL_PID=Express' -p 1433:1433 -d mcr.microsoft.com/mssql/server:2017-latest-ubuntu
4) docker exec -it unruffled_tharp "bash"
5) /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'yourStrong(!)Password'
6) 创建数据库
7) 尝试使用 VSCode 扩展连接 MSSQL 图像并且它有效
8) 将相同的连接字符串传递到 nopCommerce 安装页面
Data Source=localhost;Initial Catalog=nop420;User ID=sa;Password=yourStrong(!)Password
但它给出了一个错误
Setup failed: An error occurred while creating the database: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server)
我尝试使用 IP 而不是 localhost,添加端口 1433 以及来自不同论坛的几乎所有内容,但错误仍然相同。
DIEA
相关分类