osamhack2021 / ai_web_RISKOUT_BTS

Risk Management Platform for the Military |🏅국방부장관상(Minister of National Defense Award)
https://riskout.org/
GNU General Public License v3.0
20 stars 1 forks source link

NLP폴더에서 docker build 죽는 현상 #4

Closed cjnghn closed 3 years ago

cjnghn commented 3 years ago

Output of docker build:

Sending build context to Docker daemon  495.8MB
Step 1/17 : FROM python:3.7.4-stretch
 ---> 9c5a6f98cfe8
Step 2/17 : WORKDIR /home/user
 ---> Using cache
 ---> 074dc5c30191
Step 3/17 : RUN apt-get update && apt-get install -y curl git pkg-config cmake apt-utils
 ---> Using cache
 ---> b870822bff9c
Step 4/17 : RUN apt-get install -y wget build-essential autotools-dev automake libmecab2 libmecab-dev
 ---> Using cache
 ---> 6a5f29f061bf
Step 5/17 : COPY riskout /home/user/riskout
 ---> Using cache
 ---> 4cc2ea384115
Step 6/17 : COPY setup.py requirements.txt /home/user/
 ---> Using cache
 ---> ecefe4c18a94
Step 7/17 : RUN pip install -r requirements.txt
 ---> Running in 20cd491bfbd3
Collecting numpy>=1.18.4
  Downloading https://files.pythonhosted.org/packages/68/2d/0fe6592a96a1da097a33fb87b9618197c8a1801e84c7483fa7b93794a87c/numpy-1.21.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.7MB)
Collecting scipy>=1.4.1
  Downloading https://files.pythonhosted.org/packages/b5/6b/8bc0b61ebf824f8c3979a31368bbe38dd247590049a994ab0ed077cb56dc/scipy-1.7.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (28.5MB)
Collecting scikit-learn>=0.22.1
  Downloading https://files.pythonhosted.org/packages/a8/eb/a48f25c967526b66d5f1fa7a984594f0bf0a5afafa94a8c4dbc317744620/scikit_learn-0.24.2-cp37-cp37m-manylinux2010_x86_64.whl (22.3MB)
Collecting konlpy>=0.5.2
  Downloading https://files.pythonhosted.org/packages/85/0e/f385566fec837c0b83f216b2da65db9997b35dd675e107752005b7d392b1/konlpy-0.5.2-py2.py3-none-any.whl (19.4MB)
Collecting pandas
  Downloading https://files.pythonhosted.org/packages/a5/2c/c82570a1b4ae3f0e0359010719c02c8cf5534e51739fad2e5283f07efb32/pandas-1.3.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.3MB)
Collecting torch==1.7.1
  Downloading https://files.pythonhosted.org/packages/90/5d/095ddddc91c8a769a68c791c019c5793f9c4456a688ddd235d6670924ecb/torch-1.7.1-cp37-cp37m-manylinux1_x86_64.whl (776.8MB)
Killed
The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 137
cjnghn commented 3 years ago

도커 사용 간 메모리 이슈 부족 이슈임을 확인하였고, stackoverflow 글 중 하나인 https://stackoverflow.com/questions/57291806/docker-build-failed-after-pip- installed-requirements-with-exit-code-137 를 참고하여 pip installpip3 install --no-cache-dir 로 바꿔 해결함

cjnghn commented 3 years ago

pip에서 --no-cache-dir 에 대한 스오플 답변

https://stackoverflow.com/questions/45594707/what-is-pips-no-cache-dir-good-for