SQL Server在初始化后停止运行的Docker容器

6

我下载了最新版本的SQL Server镜像,并按照docker hub页面这里的说明进行操作。

问题在于,当我运行以下命令启动容器时,容器会停止,并且我无法在正在运行的容器中找到它,使用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
查看错误日志:错误:无法设置系统管理员密码:密码验证失败。 密码未能符合 SQL Server 密码策略要求,因为它太短了。密码必须至少为8个字符。当您运行docker ps -a时,容器是否显示? - KeukenkastjeXYZ
1
非常感谢。它解决了我的问题。 - Milad Bonakdar
2个回答

5

我尝试了同样的方法,只需要做两处修改: - 我必须将密码改为包含大写字母:fakePassw0rd - 在镜像名称前添加"-d"标志


2

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接