Window安装docker

1、安装 Hyper-V

控制面板-卸载程序-启用或关闭Windows功能

hyper-v

也可以通过命令来启用 Hyper-V ,请右键开始菜单并以管理员身份运行 PowerShell,执行以下命令:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

2、下载安装docker Desktop on Windows

https://docs.docker.com/desktop/windows/install/

3、下载 Linux 内核更新包

注意: 在非英文版 Windows 上,你可能必须修改搜索文本,对“System Type”字符串进行翻译。 你可能还需要对引号进行转义来用于 find 命令。 例如,在德语版中使用 systeminfo | find '"Systemtyp"'

直接安装

4、配置

注册账号,登录后点击配置Docker国内镜像加速下载:左侧菜单 Docker Engine -> 右侧输入框 -> Apply & Restart

配置代码

{
  "registry-mirrors": [
    "https://registry.docker-cn.com",
    "http://hub-mirror.c.163.com",
    "https://docker.mirrors.ustc.edu.cn"
  ],
  "insecure-registries": [],
  "debug": false,
  "experimental": false,
  "features": {
    "buildkit": true
  },
  "builder": {
    "gc": {
      "enabled": true,
      "defaultKeepStorage": "20GB"
    }
  }
}

启动一个docker的帮助文档镜像

cmd -> 回车

docker run -d -p 80:80 docker/getting-started

打开帮助文档镜像

http://localhost/

5、nginx镜像安装

在docker的hub搜索nginx镜像

https://hub.docker.com/

查到软件nginx版本号

cmd命令安下载安装nginx

docker pull nginx:1.21.6

检查是否下载成功

docker images

测试镜像

docker run --name nginx -p 9091:80 -d nginx:1.21.6

查看运行状态

docker ps
游荡时间:
到此一游: xoxu