From ca5da233006900141f57cda3fb7aa9d800b89631 Mon Sep 17 00:00:00 2001 From: "YILI-HOME\\yili" Date: Sun, 18 Nov 2018 12:52:38 +0800 Subject: [PATCH] Update windows suppport script Signed-off-by: YILI-HOME\yili --- README.md | 15 ++++++++++++--- load_images.ps1 | 9 +++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 load_images.ps1 diff --git a/README.md b/README.md index 355df07..5233975 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ NOTE: * The master branch is tested with Docker for Mac/Windows 18.09/18.06 (with Kubernetes 1.10.3). If you want to use Docker for Mac/Windows 18.03, please use the 18.03 branch ```git checkout 18.03``` -* If you run on Windows, please execute following commands in Bash shell +* If you run on Windows, please execute following commands in Bash shell or PowerShell -### Enable Kubernetes on Docker for Mac or Windows +### Enable Kubernetes on Docker for Mac/Windows Config registry mirror for Docker daemon with ```https://registry.docker-cn.com``` @@ -13,12 +13,21 @@ Config registry mirror for Docker daemon with ```https://registry.docker-cn.com` Preload Kubernetes images form Alibaba Cloud Registry Service, NOTE: you can modify the ```images.properties``` for your own images +In Bash shell + ``` ./load_images.sh ``` -Enable Kubernetes in Docker for Mac, and wait a while for Kubernetes is running +or in Power Shell of Windows + +``` + .\load_images.ps1 +``` + +NOTE: if you failed to start PowerShell scripts for security policy, please execute ```Set-ExecutionPolicy RemoteSigned``` command in PowerShell with "Run as administrator" option. +Enable Kubernetes in Docker for Mac/Windows, and wait a while for Kubernetes is running ![k8s](./k8s.jpg) diff --git a/load_images.ps1 b/load_images.ps1 new file mode 100644 index 0000000..4773221 --- /dev/null +++ b/load_images.ps1 @@ -0,0 +1,9 @@ +foreach($line in Get-Content .\images.properties) { + $data = $line.Split('=') + $key = $data[0]; + $value = $data[1]; + Write-Output "$key=$value" + docker pull ${value} + docker tag ${value} ${key} + docker rmi ${value} +} \ No newline at end of file