我尝试在ansible playbook中执行命令docker-compose -f dev.yml build
。但得到了错误command 'gcc' failed with exit status 4
。我已经尝试安装python-dev
和python3-dev
库。在剧本之外(来自shell)构建是成功的。
更多日志信息:
"Running setup.py install for psycopg2: started",
"
Running setup.py install for psycopg2: finished with status 'done'",
" Running setup.py install for regex: started",
"
Running setup.py install for regex: finished with status 'error'",
"
Complete output from command /usr/local/bin/python3.5 -u -c \"import setuptools, tokenize;__file__='/tmp/pip-build-7c_6j3bh/regex/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))\" install --record /tmp/pip-bh121iai-record/install-record.txt --single-version-externally-managed --compile:", "
running install", "
running build", "
running build_py", "
creating build", "
creating build/lib.linux-x86_64-3.5", "
copying Python3/regex.py -> build/lib.linux-x86_64-3.5", "
copying Python3/_regex_core.py -> build/lib.linux-x86_64-3.5", "
copying Python3/test_regex.py -> build/lib.linux-x86_64-3.5", "
running build_ext", "
building '_regex' extension", "
creating build/temp.linux-x86_64-3.5", "
creating build/temp.linux-x86_64-3.5/Python3", "
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.5m -c Python3/_regex.c -o build/temp.linux-x86_64-3.5/Python3/_regex.o", "
Python3/_regex.c: In function ‘do_best_fuzzy_match’:", "
Python3/_regex.c:16680:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]", "
for (i = 0; i < best_list.count; i++) {", "
^", "
Python3/_regex.c:16714:77: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]", "
if (state->total_errors < error_limit || i == 0 &&", "
^", "
gcc: internal compiler error: Killed (program cc1)", "
Please submit a full bug report,", "
with preprocessed source if appropriate.", "
See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.", "
error: command 'gcc' failed with exit status 4", "
", "
----------------------------------------", "\u001b[91mCommand \"/usr/local/bin/python3.5 -u -c \"import setuptools, tokenize;__file__='/tmp/pip-build-7c_6j3bh/regex/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))\" install --record /tmp/pip-bh121iai-record/install-record.txt --single-version-externally-managed --compile\" failed with error code 1 in /tmp/pip-build-7c_6j3bh/regex/", "\u001b[0m"], "warnings": []}
答案 0 :(得分:1)
Thx到Konstantin Suvorov。我的问题是内存不足。然后我在构建命令docker-compose -f dev.yml stop
之前使用命令docker-compose -f dev.yml build
停止docker-compose