CPU docker 构建命令期间的资源 Windows
CPU resources during docker build command on Windows
如何控制 Windows 上的 docker build
命令使用了多少个逻辑处理器?
我有这个 dockerfile:
FROM mcr.microsoft.com/windows/servercore:1803
SHELL ["powershell", "-NoLogo"]
RUN Get-ComputerInfo -Property *proc*
CMD Get-ComputerInfo -Property *proc*
当我构建图像时,我看到以下输出:
CsNumberOfLogicalProcessors : 2
CsNumberOfProcessors : 1
请注意,我的计算机有 4 个逻辑处理器,当我使用 运行 带有 --cpus 4
选项的容器时,我得到了预期的结果:
CsNumberOfLogicalProcessors : 4
CsNumberOfProcessors : 1
让我感到困惑的是为什么 docker build
不支持 --cpus
选项,因为它 运行 在创建图像层时是容器。
Docker 信息:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 41
Server Version: 18.09.0
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: ics l2bridge l2tunnel nat null overlay transparent
Log: awslogs etwlogs fluentd gelf json-file local logentries splunk syslog
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 17763 (17763.1.amd64fre.rs5_release.180914-1434)
Operating System: Windows 10 Pro Version 1809 (OS Build 17763.194)
OSType: windows
Architecture: x86_64
CPUs: 4
Total Memory: 7.891GiB
Name: Robo
ID: K3BP:UY7Z:JEXA:EJZ6:IYK6:WMW4:L4P4:5GTY:VR7K:SQKR:5QMO:AIEA
Docker Root Dir: C:\ProgramData\Docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: -1
Goroutines: 28
System Time: 2018-12-16T16:48:59.7060639Z
EventsListeners: 1
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
目前不支持。您可以在此处跟踪问题 https://github.com/moby/moby/issues/38387
如何控制 Windows 上的 docker build
命令使用了多少个逻辑处理器?
我有这个 dockerfile:
FROM mcr.microsoft.com/windows/servercore:1803
SHELL ["powershell", "-NoLogo"]
RUN Get-ComputerInfo -Property *proc*
CMD Get-ComputerInfo -Property *proc*
当我构建图像时,我看到以下输出:
CsNumberOfLogicalProcessors : 2
CsNumberOfProcessors : 1
请注意,我的计算机有 4 个逻辑处理器,当我使用 运行 带有 --cpus 4
选项的容器时,我得到了预期的结果:
CsNumberOfLogicalProcessors : 4
CsNumberOfProcessors : 1
让我感到困惑的是为什么 docker build
不支持 --cpus
选项,因为它 运行 在创建图像层时是容器。
Docker 信息:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 41
Server Version: 18.09.0
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: ics l2bridge l2tunnel nat null overlay transparent
Log: awslogs etwlogs fluentd gelf json-file local logentries splunk syslog
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 17763 (17763.1.amd64fre.rs5_release.180914-1434)
Operating System: Windows 10 Pro Version 1809 (OS Build 17763.194)
OSType: windows
Architecture: x86_64
CPUs: 4
Total Memory: 7.891GiB
Name: Robo
ID: K3BP:UY7Z:JEXA:EJZ6:IYK6:WMW4:L4P4:5GTY:VR7K:SQKR:5QMO:AIEA
Docker Root Dir: C:\ProgramData\Docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: -1
Goroutines: 28
System Time: 2018-12-16T16:48:59.7060639Z
EventsListeners: 1
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
目前不支持。您可以在此处跟踪问题 https://github.com/moby/moby/issues/38387