我们正在尝试使用 Ubuntu 在 Docker 容器内创建带有 MQ 的构建计划。该sudo
命令在 Dockerfile 中不起作用,因此我们无法使用在网上找到的解决方案。以下是我们收到的错误:
build 16-May-2018 09:43:53 .[91mW: chown to _apt:root of directory /var/cache/apt/archives/partial failed - SetupAPTPartialDirectory (12: Cannot allocate memory)
build 16-May-2018 09:43:53 W: chmod 0700 of directory /var/cache/apt/archives/partial failed - SetupAPTPartialDirectory (12: Cannot allocate memory)
加:
error 16-May-2018 09:43:54 The command '/bin/sh -c apt-get install -y --no-install-recommends bash ca-certificates coreutils curl debianutils findutils grep libc-bin mount passwd procps sed tar util-linux apt-utils bc file gawk lsb-release vim' returned a non-zero code: 100
simple 16-May-2018 09:43:54 Failing task since return code of [/bin/sh /opt/lforge/atlassian_data/bamboo_home/temp/MI-IWMFD-JOB1-20-ScriptBuildTask-6009970739082824316.sh] was 100 while expected 0
simple 16-May-2018 09:43:54 Finished task 'Build Docker Image' with result: Failed
答案1
我的团队成员(Darren)想出了一个解决方案。Docker 使用默认值 2g。更改了 docker 命令,使其具有参数 -m 4g 以获取额外内存。