docker-compose生成错误:命令'gcc'失败,退出状态4

我正在尝试执行docker-compose -f dev.yml build剧本。 但是得到错误command 'gcc' failed with exit status 4 。 我已经尝试安装python-devpython3-dev库。 剧本之外(从shell)构build是成功的。

更多日志信息:

 "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": []} 

Thx 康斯坦丁苏沃洛夫 。 我的问题是没有足够的记忆。 然后我停止docker-compose -f dev.yml stop -compose命令docker-compose -f dev.yml stop在build命令之前docker-compose -f dev.yml stop docker-compose -f dev.yml build