Can Docker Engine start containers in parallel

2019-04-07 15:03发布

If I have scripts issueing docker run commands in parallel, the docker engine appears to handle these commands in series. Since runing a minimal container image with "docker run" takes around 100ms to start does this mean issueing commands in parallel to run 1000 containers will take the docker engine 100ms x 1000 = 100 s or nearly 2 minutes? Is there some reason why the docker engine is serial instead of parallel? How do people get around this?

标签: docker
1条回答
Fickle 薄情
2楼-- · 2019-04-07 15:42

How do people get around this?

a/ They don't start 1000 containers at the same time b/ if they do, they might use a cluster management system like docker swarm to manage the all process c/ they do run 1000 containers, in advance in order to take into account the starting time.

Truly parallelize docker run command could be tricky considering some of those command might depend on other containers to be created/started first (like a docker run --volumes-from=xxx)

查看更多
登录 后发表回答