s38.windows11家庭版安装docker desktop

625 阅读2分钟

一、安装Hyper-V# 1.将一下代码添加到记事本文件中,并另存为hyper.bat。

pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL

2.右键以管理员身份运行,遇见判断全部选是或者Y。 3.运行完毕后,重启即可。 二、开启hyper-v# 1.以管理员身份打开cmd,执行以下两条命令: 启动WSL

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

启动虚拟机的功能

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

2.重启电脑生效 三、更新wsl2# 1.下载安装 wsl2 wslstorestorage.blob.core.windows.net/wslblob/wsl… 2.安装wsl2 3.以管理员身份打开cmd,执行以下命令将wsl2设置为默认版本:

wsl --set-default-version 2

四、安装Docker Desktop 在官网下载:www.docker.com/get-started… 四、闪退问题# 安装后打开docker闪退, 1.cmd执行以下命令

netsh winsock reset

如果docker 进去一直转圈圈 删除下面文件重新进去就好了

C:\Users\用户名\AppData\Roaming\Docker\settings.json

五、镜像加速 1.在settings的Docker Engine里添加下面代码

  "registry-mirrors": [
    "https://registry.docker-cn.com",
    "http://hub-mirror.c.163.com",
    "https://docker.mirrors.ustc.edu.cn"
  ]

在这里插入图片描述

2.点击 Apply&Restart 等待重启,在终端输入 docker info 查看是否成功

C:\WINDOWS\system32>docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.8.2)
  compose: Docker Compose (Docker Inc., v2.6.0)
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 2
 Server Version: 20.10.16
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 212e8b6fa2f44b9c21b2798135fc6fb7c53efc16
 runc version: v1.1.1-0-g52de29d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.10.16.3-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 31.05GiB
 Name: docker-desktop
 ID: FD63:62O6:SNCE:USEM:MIIV:FFMT:RKIK:V3ZI:3OKZ:WQGP:7ZOY:BZPJ
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Registry Mirrors: #在这里可以看到镜像加速设置
  https://registry.docker-cn.com/
  http://hub-mirror.c.163.com/
  https://docker.mirrors.ustc.edu.cn/
 Live Restore Enabled: false