Skip to content

Commit 40d0ae3

Browse files
committed
GCE: add EventLog registry key for docker
1 parent a07c73d commit 40d0ae3

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

cluster/gce/windows/configure.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ try {
9696
Create-Directories
9797
Download-HelperScripts
9898

99+
Create-DockerRegistryKey
99100
Create-PauseImage
100101
DownloadAndInstall-KubernetesBinaries
101102
Create-NodePki

cluster/gce/windows/k8s-node-setup.psm1

+20
Original file line numberDiff line numberDiff line change
@@ -1030,5 +1030,25 @@ function Verify-WorkerServices {
10301030
Log_Todo "run more verification commands."
10311031
}
10321032

1033+
# Add a registry key for docker in EventLog so that log messages are mapped
1034+
# correctly. This is a workaround since the key is missing in the base image.
1035+
# https://github.com/MicrosoftDocs/Virtualization-Documentation/pull/503
1036+
# TODO: Fix this in the base image.
1037+
function Create-DockerRegistryKey {
1038+
$tmp_dir = 'C:\tmp_docker_reg'
1039+
New-Item -Force -ItemType 'directory' ${tmp_dir} | Out-Null
1040+
$reg_file = 'docker.reg'
1041+
Set-Content ${tmp_dir}\${reg_file} `
1042+
'Windows Registry Editor Version 5.00
1043+
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\docker]
1044+
"CustomSource"=dword:00000001
1045+
"EventMessageFile"="C:\\Program Files\\docker\\dockerd.exe"
1046+
"TypesSupported"=dword:00000007'
1047+
1048+
Log-Output "Importing registry key for Docker"
1049+
reg import ${tmp_dir}\${reg_file}
1050+
Remove-Item -Force -Recurse ${tmp_dir}
1051+
}
1052+
10331053
# Export all public functions:
10341054
Export-ModuleMember -Function *-*

0 commit comments

Comments
 (0)