1、在Windows下安装Docker-desktop
下载:
https://github.com/tech-shrimp/docker_installer/releases/download/latest/docker_desktop_installer_windows_x86_64.exe
2、安装:
start /w "" "docker_desktop_installer_windows_x86_64.exe" install --installation-dir=D:\Docker
3、安装完成后,重启启动没反应,这是因为需要安装wsl
4、安装wsl:cmd下操作
<!-- 下载 wsl 安装包 --> curl https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi -O wsl_update_x64.msi <!-- 安装 wsl 安装包 --> msiexec .\wsl_update_x64.msi <!-- 将wsl2设置为默认版本 --> wsl --set-default-version 2
5、然后Docker-desktop做一些相应配置:
{ "builder": { "gc": { "defaultKeepStorage": "20GB", "enabled": true } }, "default-runtime": "nvidia", "experimental": false, "runtimes": { "nvidia": { "path": "nvidia-container-runtime", "runtimeArgs": [] } } }
然后restart docker desktop,
C:\WINDOWS\system32>docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES C:\WINDOWS\system32>docker pull registry.cn-hangzhou.aliyuncs.com/jsonhc/nginx:1.15 1.15: Pulling from jsonhc/nginx 743f2d6c1f65: Pull complete 6bfc4ec4420a: Pull complete 688a776db95f: Pull complete Digest: sha256:e770165fef9e36b990882a4083d8ccf5e29e469a8609bb6b2e3b47d9510e2c8d Status: Downloaded newer image for registry.cn-hangzhou.aliyuncs.com/jsonhc/nginx:1.15 registry.cn-hangzhou.aliyuncs.com/jsonhc/nginx:1.15
启动镜像后,可以看见启动的镜像服务:
C:\WINDOWS\system32>docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES dea6ea340ca6 registry.cn-hangzhou.aliyuncs.com/jsonhc/nginx:1.15 "nginx -g 'daemon of…" 36 seconds ago Up 34 seconds 80/tcp sharp_vaughan
然后关闭防火墙:
浏览器进行访问:
标签:1.15,Windows,wsl,desktop,nginx,Docker,jsonhc,docker From: https://www.cnblogs.com/jsonhc/p/18284788