当前位置: 首页 > news >正文

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执行起来比较麻烦)

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执行)

./dockerdesk.exe install --accept-license --backend=wsl-2 --installation-dir='H:\program\DockerDesktop' --wsl-default-data-root='H:\program\DockerDesktopWSL' 
  1. 稍等片刻, 按照提示安装下一步next,安装完成.
  2. 打开软件,查看安装设置无误:
    在这里插入图片描述6

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

  • Win11 安装 Docker Desktop 和 WSL2 并进行安装位置迁移
http://www.lryc.cn/news/454655.html

相关文章:

  • 排查和解决JVM OOM实战
  • 【Swift官方文档】7.Swift集合类型
  • QT调用最新的libusb库
  • 白嫖EarMaster Pro 7简体中文破解版下载永久激活
  • 使用JavaScript写一个网页端的四则运算器
  • Linux find命令详解及实用示例
  • CSS基础-常见属性(二)
  • Spring Boot 2.4.3 + Java 8 升级为 Java 21 + Spring Boot 3.2.0
  • 如何利用免费音频剪辑软件制作出精彩音频
  • 安宝特分享 | AR技术重塑工业:数字孪生与沉浸式培训的创新应用
  • 专题十_穷举vs暴搜vs深搜vs回溯vs剪枝_二叉树的深度优先搜索_算法专题详细总结
  • 基于springboot vue3 在线考试系统设计与实现 源码数据库 文档
  • 什么是 HTTP 请求中的 options 请求?
  • [图形学]smallpt代码详解(1)
  • Vite多环境配置与打包:
  • git维护【.gitignore文件】
  • 【Canvas与色彩】十六等分多彩隔断圆环
  • 什么是pip? -- Python 包管理工具
  • FastAPI框架使用枚举来型来限定参数、FastApi框架隐藏没多大意义的Schemes模型部分内容以及常见的WSGI服务器Gunicorn、uWSGI了解
  • OceanBase—02(入门篇——对于单副本单节点,由1个observer扩容为3个observer集群)——之前的记录,当初有的问题未解决,目前新版未尝试
  • 前沿论文创新点集合
  • 刷题记录(好题)
  • 【大数据入门 | Hive】函数{单行函数,集合函数,炸裂函数,窗口函数}
  • python sqlite3 工具函数
  • 顺丰Android面试题集锦及参考答案
  • uniapp中检测应用更新的两种方式-升级中心之uni-upgrade-center-app
  • Python爬虫通过 Cookie 和会话管理来维持其在网站上的会话状态
  • 使用STM32单片机实现无人机控制系统
  • 【包教包会】2D图片实现3D透视效果(支持3.x、支持原生、可合批)
  • 解决nginx+tomcat宕机完美解决方案