我可以将--max-concurrent-downloads作为标志传递吗? [英] Can I pass --max-concurrent-downloads as a flag?

查看:280
本文介绍了我可以将--max-concurrent-downloads作为标志传递吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网络连接不佳,试图拉出并运行图像。



我想一次下载一层,并且每个文档都尝试添加平坦的--max-concurrent-downloads像这样:

  docker run --rm -p 8787:8787 -e PASSWORD = blah --max-concurrent-downloads = 1摇杆/节

但这会产生错误:


未知标志:--max-concurrent-downloads请参见 docker run --help。




我尝试键入 docker run --help ,有趣的是没有看到--max-concurrent-downloads选项。



由于我使用的是旧Mac,因此我正在使用Docker Toolbox。



在这里l下有一个选项用于--max-concurrent-downloads,但是在键入 docker run --help





如何更改默认下载3层的默认设置时间到一个?

解决方案

启动守护程序时,此设置需要传递给dockerd,而不是docker客户端CLI。 dockerd进程在具有docker-machine(和其他docker桌面环境)的VM内运行。



使用 docker-machine ,通常会在 docker-machine create 命令行上传递引擎标志,例如

  docker-machine create --engine-opt max-concurrent-downloads = 1 

一旦创建了计算机,就可以按照以下答案中的步骤来修改配置



  1. SSH到本地Docker VM中。

    注意:如果'default'不是您的docker计算机的名称,则将'default'替换为您的docker计算机名称 $
    docker-machine ssh默认


  2. 打开Docker配置文件 $ sudo vi / var / lib / boot2docker / profile





然后在该配置文件中,添加您的-engine-opt max-concurrent-downloads = 1






较新版本的Docker桌面(以及所有Linux安装)通过配置菜单守护程序使此操作更加容易-> Advanced您可以在其中指定daemon.json条目,例如:

  {
max-concurrent-downloads:1
}


I'm working with a poor internet connection and trying to pull and run a image.

I wanted to download one layer at a time and per documentation tried adding a flat --max-concurrent-downloads like so:

docker run --rm -p 8787:8787 -e PASSWORD=blah --max-concurrent-downloads=1 rocker/verse

But this gives an error:

unknown flag: --max-concurrent-downloads See 'docker run --help'.

I tried typing docker run --help and interestingly did not see the option --max-concurrent-downloads.

I'm using Docker Toolbox since I'm on a old Mac.

Over here under l there's an option for --max-concurrent-downloads however this doesn't appear on my terminal when typing docker run --help

How can I change the default of downloading 3 layers at a time to just one?

解决方案

This setting needs to be passed to dockerd when starting the daemon, not to the docker client CLI. The dockerd process is running inside of a VM with docker-machine (and other docker desktop environments).

With docker-machine that is used in toolbox, you typically pass the engine flags on the docker-machine create command line, e.g.

docker-machine create --engine-opt max-concurrent-downloads=1

Once you have a created machine, you can follow the steps from these answers to modify the config of an already running machine, mainly:

  1. SSH into your local docker VM.
    note: if 'default' is not the name of your docker machine then substitute 'default' with your docker machine name $ docker-machine ssh default

  2. Open Docker profile $ sudo vi /var/lib/boot2docker/profile

Then in that profile, you would add your --engine-opt max-concurrent-downloads=1.


Newer versions of docker desktop (along with any Linux install) make this much easier with a configuration menu daemon -> advanced where you can specify your daemon.json entries like:

{
  "max-concurrent-downloads": 1
}

这篇关于我可以将--max-concurrent-downloads作为标志传递吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆