在Docker引用中,我没有找到任何关于字符串可以传递到Docker多长时间的信息。
什么是limitations?
发布于 2022-01-17 08:54:50
@ZenithS您适合Windows (8192个字符),但是Linux并不是那么容易。
简而言之:对于Linux,它是硬编码到64或128个kiB。您可以使用xargs --show-limits进行检查,它提供了非常详细的概述:
Your environment variables take up 5354 bytes
POSIX upper limit on argument length (this system): 2089750 <-- ARG_MAX
POSIX smallest allowable upper limit on argument length (all systems): 4096
Maximum length of command we could actually use: 2084396 <-- ARG_MAX - ENV
Size of command buffer we are actually using: 131072 <-- Hardcoded limit which applies actually (see below)
Maximum parallelism (--max-procs must be no greater): 2147483647硬编码限制转到MAX_ARG_STRLEN,它被设置为PAGE_SIZE * 32 https://github.com/torvalds/linux/blob/v5.16-rc7/include/uapi/linux/binfmts.h#L15
使用getconf PAGE_SIZE,您可以检查(在现代平台上主要是2048或4096 ),从而得到64或128个kiB。
发布于 2022-01-17 07:35:29
我做了一个简单的测试,发现在我的CentOS 7/x64机器上,dockerfile行的限制是65535。
#./build.sh
Sending build context to Docker daemon 363kB
Error response from daemon: failed to parse Dockerfile: dockerfile line greater than max allowed size of 65535https://stackoverflow.com/questions/70737793
复制相似问题