sql-server - 初始化后SQL Server docker容器停止

标签 sql-server docker

我下载了最新版本的SQL Server镜像,并且按照docker hub页面here中给出的说明进行操作

问题是,当我通过运行以下命令启动容器时,容器停止运行,并且无法使用docker ps在运行的容器中找到它

docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=fakepassw0rd' -p 1433:1433 mcr.microsoft.com/mssql/server

结果 :

2019-04-22 19:16:13.67 Server      Setup step is copying system data file 'C:\templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf'.
2019-04-22 19:16:13.74 Server      Did not find an existing master data file /var/opt/mssql/data/master.mdf, copying the missing default master and other system database files. If you have moved the database location, but not moved the database files, startup may fail. To repair: shutdown SQL Server, move the master database to configured location, and restart.
2019-04-22 19:16:13.75 Server      Setup step is copying system data file 'C:\templatedata\mastlog.ldf' to '/var/opt/mssql/data/mastlog.ldf'.
2019-04-22 19:16:13.76 Server      Setup step is copying system data file 'C:\templatedata\model.mdf' to '/var/opt/mssql/data/model.mdf'.
2019-04-22 19:16:13.77 Server      Setup step is copying system data file 'C:\templatedata\modellog.ldf' to '/var/opt/mssql/data/modellog.ldf'.
2019-04-22 19:16:13.79 Server      Setup step is copying system data file 'C:\templatedata\msdbdata.mdf' to '/var/opt/mssql/data/msdbdata.mdf'.
2019-04-22 19:16:13.82 Server      Setup step is copying system data file 'C:\templatedata\msdblog.ldf' to '/var/opt/mssql/data/msdblog.ldf'.
2019-04-22 19:16:13.93 Server      Microsoft SQL Server 2017 (RTM-CU11) (KB4462262) - 14.0.3038.14 (X64)
        Sep 14 2018 13:53:44
        Copyright (C) 2017 Microsoft Corporation
        Developer Edition (64-bit) on Linux (Ubuntu 16.04.5 LTS)
2019-04-22 19:16:13.94 Server      UTC adjustment: 0:00
2019-04-22 19:16:13.95 Server      (c) Microsoft Corporation.
2019-04-22 19:16:13.95 Server      All rights reserved.
2019-04-22 19:16:13.95 Server      Server process ID is 4120.
2019-04-22 19:16:13.95 Server      Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'.
2019-04-22 19:16:13.95 Server      Registry startup parameters:
         -d /var/opt/mssql/data/master.mdf
         -l /var/opt/mssql/data/mastlog.ldf
         -e /var/opt/mssql/log/errorlog
2019-04-22 19:16:13.96 Server      SQL Server detected 1 sockets with 2 cores per socket and 2 logical processors per socket, 2 total logical processors; using 2 logical processors based on SQL Server licensing. This is an informational message; no user action is required.
2019-04-22 19:16:13.97 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2019-04-22 19:16:13.98 Server      Detected 1584 MB of RAM. This is an informational message; no user action is required.
2019-04-22 19:16:13.98 Server      Using conventional memory in the memory manager.
2019-04-22 19:16:14.14 Server      Buffer pool extension is already disabled. No action is necessary.
2019-04-22 19:16:14.27 Server      InitializeExternalUserGroupSid failed. Implied authentication will be disabled.
2019-04-22 19:16:14.28 Server      Implied authentication manager initialization failed. Implied authentication will be disabled.
2019-04-22 19:16:14.29 Server      Successfully initialized the TLS configuration. Allowed TLS protocol versions are ['1.0 1.1 1.2']. Allowed TLS ciphers are ['ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:!DHE-RSA-AES256-GCM-SHA384:!DHE-RSA-AES128-GCM-SHA256:!DHE-RSA-AES256-SHA:!DHE-RSA-AES128-SHA'].
2019-04-22 19:16:14.32 Server      The maximum number of dedicated administrator connections for this instance is '1'
2019-04-22 19:16:14.33 Server      Node configuration: node 0: CPU mask: 0x0000000000000003:0 Active CPU mask: 0x0000000000000003:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
2019-04-22 19:16:14.34 Server      Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.
2019-04-22 19:16:14.36 Server      In-Memory OLTP initialized on lowend machine.
2019-04-22 19:16:14.46 Server      Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required.
ForceFlush is enabled for this instance.
2019-04-22 19:16:14.47 Server      Query Store settings initialized with enabled = 1,
2019-04-22 19:16:14.48 spid7s      Starting up database 'master'.
2019-04-22 19:16:14.49 Server      Software Usage Metrics is disabled.
ForceFlush feature is enabled for log durability.
2019-04-22 19:16:14.71 spid7s      The tail of the log for database master is being rewritten to match the new sector size of 4096 bytes.  3072 bytes at offset 418816 in file /var/opt/mssql/data/mastlog.ldf will be written.
2019-04-22 19:16:14.91 spid7s      Converting database 'master' from version 862 to the current version 869.
2019-04-22 19:16:14.91 spid7s      Database 'master' running the upgrade step from version 862 to version 863.
2019-04-22 19:16:14.99 spid7s      Database 'master' running the upgrade step from version 863 to version 864.
2019-04-22 19:16:15.04 spid7s      Database 'master' running the upgrade step from version 864 to version 865.
2019-04-22 19:16:15.05 spid7s      Database 'master' running the upgrade step from version 865 to version 866.
2019-04-22 19:16:15.08 spid7s      Database 'master' running the upgrade step from version 866 to version 867.
2019-04-22 19:16:15.09 spid7s      Database 'master' running the upgrade step from version 867 to version 868.
2019-04-22 19:16:15.13 spid7s      Database 'master' running the upgrade step from version 868 to version 869.
2019-04-22 19:16:15.44 spid7s      Resource governor reconfiguration succeeded.
2019-04-22 19:16:15.46 spid7s      SQL Server Audit is starting the audits. This is an informational message. No user action is required.
2019-04-22 19:16:15.46 spid7s      SQL Server Audit has started the audits. This is an informational message. No user action is required.
2019-04-22 19:16:15.56 spid7s      SQL Trace ID 1 was started by login "sa".
2019-04-22 19:16:15.59 spid19s     Password policy update was successful.
2019-04-22 19:16:15.60 spid7s      Server name is '75d968b3f551'. This is an informational message only. No user action is required.
2019-04-22 19:16:15.64 spid21s     Always On: The availability replica manager is starting. This is an informational message only. No user action is required.
2019-04-22 19:16:15.65 spid8s      Starting up database 'mssqlsystemresource'.
2019-04-22 19:16:15.66 spid7s      Starting up database 'msdb'.
2019-04-22 19:16:15.66 spid21s     Always On: The availability replica manager is waiting for the instance of SQL Server to allow client connections. This is an informational message only. No user action is required.
2019-04-22 19:16:15.68 spid8s      The resource database build version is 14.00.3038. This is an informational message only. No user action is required.
2019-04-22 19:16:15.72 spid8s      Starting up database 'model'.
2019-04-22 19:16:15.96 spid24s     ERROR: Unable to set system administrator password: Password validation failed. The password does not meet SQL Server password policy requirements because it is too short. The password must be at least 8 characters..
2019-04-22 19:16:15.97 spid24s     An error occurred during server setup. See previous errors for more information.
2019-04-22 19:16:15.97 spid24s     SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
2019-04-22 19:16:16.03 spid19s     A self-generated certificate was successfully loaded for encryption.
2019-04-22 19:16:16.04 spid19s     Server is listening on [ 'any' <ipv4> 1433].

最佳答案

我尝试了相同的方法,它可以进行2次调整:
-我必须更改密码以包括大写字母:fakePassw0rd
-我在图片名称前添加了“-d”标志

关于sql-server - 初始化后SQL Server docker容器停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55799894/

相关文章:

sql-server - 关于HierarchyId (SQL Server 2008)的一些问题

SQL如何提取字符串的中间部分

docker - SSH key 不断从 Google Compute Engine VM 中删除

php - Docker - 安装 Composer/bin/sh : 1: php: not found curl: (23) Failed writing body (0 ! = 16133)

macos - nginx docker容器上的连接被拒绝

docker compose、vagrant 和不安全的存储库

sql - SQL Server 上的存储过程 "recompile"意味着什么?

sql-server - 查询 where date = '2016/01/02' 不工作?

c# - 为 SQL Server Linux 版本安装 CLR

docker - Docker:来自守护程序的错误响应:附加到网络失败