windows下DockerDesktop命令行方式指定目录安装

windows下DockerDesktop指定目录安装(重新安装)

因为DcokerDesktop占用内存较大, 并且拉去镜像后占用本地空间较多,所以建议安装时就更改默认安装路径镜像存储路径

这里,展示了从下载到安装的过程:

  1. 首先下载DcokerDesktop;
  2. 找到Docker Desktop Installer.exe 并重命名为 dockerdesk.exe , 并建议将其移动到全英文路径下(我这里放在了J:/dockerdesk.exe);
  3. 阅读官方安装指南docker desktop从命令行安装install-from-the-command-line 按需要添加参数,更改默认安装目录.
    可以看到, 文档中官方给出的命令行参数说明很详细;

可以在本地powershell中使用 如下方式查看dockerdesk.exe都有哪些参数: (记得重命名, .exe名称有空格,用cmd执行起来比较麻烦)

powershell 复制代码
PS J:\> ./dockerdesk.exe --help
PS J:\> 
Installs Docker Desktop

"dockerdesk.exe" install [--quiet] [--accept-license] [--backend=wsl-2 | --backend=hyper-v | --backend=windows] [--allowed-org=<org name>]

--quiet                   Suppresses information output when running the installer
--accept-license          Accepts the Docker Subscription Service Agreement now, rather than requiring it to be accepted when the application is first run
--no-windows-containers   Disables Windows containers integration
--allowed-org=<org name>  Requires the user to sign in and be part of the specified Docker Hub organization when running the application
--backend=<backend name>  Selects the default backend to use for Docker Desktop, hyper-v, windows or wsl-2 (default)
--always-run-service  Keep service always running, so regular users can switch to windows containers or hyper-v without being prompted for admin rights
--installation-dir=<path> Changes the default installation location (C:\Program Files\Docker\Docker)     
--hyper-v-default-data-root=<path> Changes the default hyper-v VM disk location
--windows-containers-default-data-root=<path> Changes the default windows containers data root
--wsl-default-data-root=<path> Changes the default wsl data location
--admin-settings=<json> Used as admin settings for hardened desktop (needs to use --allowed-org and specify a business tier org)
--proxy-http-mode=<mode> HTTP Proxy mode, system (default) or manual
--override-proxy-http=<URL> URL of the HTTP proxy that must be used for outgoing HTTP requests
--override-proxy-https=<URL> URL of the HTTP proxy that must be used for outgoing HTTPS requests
--override-proxy-exclude=<hosts/domains> Bypass proxy settings for these hosts & domains, comma-separated list
--proxy-enable-kerberosntlm Enables Kerberos/NTLM proxy authentication
  1. 要做什么? 我的需求是

    • 指定 docker-desktop 安装位置(软件本体), 为 H:\program\DockerDesktop
    • 指定 docker-desktop-data 安装位置(本地镜像等存储路径,即为 Settings->Resources Advanced-> Disk image location的路径),为H:\program\DockerDesktopWSL
  2. 编写命令行(用powershellJ:/dockerdesk.exe同级目录执行)

使用了如下参数

./dockerdesk.exe install

--accept-license --backend=wsl-2

--installation-dir='docker-desktop安装位置'

--wsl-default-data-root='docker-desktop-data安装位置'
命令执行前,请创建好 H:\program\DockerDesktopWSL H:\program\DockerDesktop这两个安装文件夹,不然可能出现意外的错误.

我使用的安装命令为: (使用powershell执行)

powershell 复制代码
./dockerdesk.exe install --accept-license --backend=wsl-2 --installation-dir='H:\program\DockerDesktop' --wsl-default-data-root='H:\program\DockerDesktopWSL' 
  1. 稍等片刻, 按照提示安装下一步next,安装完成.
  2. 打开软件,查看安装设置无误:

windows下DockerDesktop的安装位置迁移(不需要重新安装)

相关推荐
2501_9032386522 分钟前
Git Bash:Windows下的强大命令行工具
windows·git·bash·个人开发
Dontla1 小时前
Docker run --add-host参数解析(在容器启动时向/etc/hosts文件中添加自定义的主机名与IP映射)(适用于临时调试或测试)
tcp/ip·docker·容器
西西小飞龙1 小时前
Docker和K8S中pod、services、container的介绍和关系
docker·容器·kubernetes
吃汤圆的抹香鲸1 小时前
GoLand 安装包 绿色版 Win,Mac,Linux 包含IntelliJ全家桶 专为Go语言设计的集成开发环境(IDE)
linux·windows·macos·go·intellij-idea·go1.19
元气满满的热码式1 小时前
Docker数据卷操作实战
linux·运维·docker·云原生·容器
kngines1 小时前
【实战 ES】实战 Elasticsearch:快速上手与深度实践-1.3.1单节点安装(Docker与手动部署)
大数据·elasticsearch·docker
吃汤圆的抹香鲸2 小时前
Rider 安装包 绿色版 Win/Mac/Linux 适合.NET和游戏开发者使用 2025全栈开发终极指南:从零配置到企业级实战
linux·运维·windows·sql·游戏·macos·.net
学海无涯,行者无疆11 小时前
使用Jenkins实现Windows服务器下C#应用程序发布
windows·c#·jenkins·.net·cicd·自动发布·一键发布
做咩啊~12 小时前
windows设置暂停更新时长
windows
飞火流星0202713 小时前
docker安装etcd:docker离线安装etcd、docker在线安装etcd、etcd镜像下载、etcd配置详解、etcd常用命令、安装常见问题总结
docker·容器·etcd