인프런 커뮤니티 질문&답변

성영창님의 프로필 이미지
성영창

작성한 질문수

Do It! 장고+부트스트랩: 파이썬 웹개발의 정석

도커 빌드시 out of memory

작성

·

510

0

안녕하세요.

배포 후 web에 수정사항이 있어서 git pull 받은 뒤에

> sudo docker-compose up -d --build  web

위 명령어를 실행했는데 out of memory 에러가 발생하네요. 

도커의 메모리를 늘려야 하나요?

---------------------------------

Building web

Sending build context to Docker daemon  13.12MB

Step 1/7 : FROM python:3.9-slim-buster

 ---> 6765f49fcf16

Step 2/7 : WORKDIR /usr/src/app

 ---> Using cache

 ---> debf846b42a4

Step 3/7 : ENV PYTHONDONTWRITEBYTECODE 1

 ---> Using cache

 ---> a95b85eb04f7

Step 4/7 : ENV PYTHONBUFFERED 1

 ---> Using cache

 ---> 9d7e9ce63802

Step 5/7 : COPY . /usr/src/app/

 ---> Using cache

 ---> bee3bb3d5424

Step 6/7 : RUN pip install --upgrade pip

 ---> Using cache

 ---> d9f3740edfc3

Step 7/7 : RUN pip install -r requirements.txt

 ---> Running in ddfc3c1e779c

OCI runtime create failed: container_linux.go:367: starting container process caused: process_linux.go:495: container ini

t caused: Running hook #0:: error running hook: exit status 2, stdout: , stderr: fatal error: runtime: out of memory

 

runtime stack:

runtime.throw(0x557f15ba819d, 0x16)

/usr/lib/golang/src/runtime/panic.go:1116 +0x74 fp=0x7fff7fe56bc0 sp=0x7fff7fe56b90 pc=0x557f13fac074

runtime.sysMap(0xc000000000, 0x4000000, 0x557f1779fe38)

/usr/lib/golang/src/runtime/mem_linux.go:169 +0xc7 fp=0x7fff7fe56c00 sp=0x7fff7fe56bc0 pc=0x557f13f8d947

runtime.(*mheap).sysAlloc(0x557f177832a0, 0x400000, 0x0, 0x4)

/usr/lib/golang/src/runtime/malloc.go:727 +0x1d4 fp=0x7fff7fe56ca8 sp=0x7fff7fe56c00 pc=0x557f13f810f4

runtime.(*mheap).grow(0x557f177832a0, 0x1, 0x0)

/usr/lib/golang/src/runtime/mheap.go:1344 +0x85 fp=0x7fff7fe56d10 sp=0x7fff7fe56ca8 pc=0x557f13f9cfa5

runtime.(*mheap).allocSpan(0x557f177832a0, 0x1, 0x37312d7069002a00, 0x557f1779fe48, 0x6e2d70612e323031)

/usr/lib/golang/src/runtime/mheap.go:1160 +0x6b6 fp=0x7fff7fe56d90 sp=0x7fff7fe56d10 pc=0x557f13f9cd56

runtime.(*mheap).alloc.func1()

/usr/lib/golang/src/runtime/mheap.go:907 +0x66 fp=0x7fff7fe56de8 sp=0x7fff7fe56d90 pc=0x557f13fdb346

runtime.(*mheap).alloc(0x557f177832a0, 0x1, 0x4012a, 0x2200000003)

/usr/lib/golang/src/runtime/mheap.go:901 +0x85 fp=0x7fff7fe56e38 sp=0x7fff7fe56de8 pc=0x557f13f9c225

runtime.(*mcentral).grow(0x557f17796158, 0x0)

/usr/lib/golang/src/runtime/mcentral.go:506 +0x7c fp=0x7fff7fe56e80 sp=0x7fff7fe56e38 pc=0x557f13f8d31c

runtime.(*mcentral).cacheSpan(0x557f17796158, 0x557f13fd945a)

/usr/lib/golang/src/runtime/mcentral.go:177 +0x3e5 fp=0x7fff7fe56ef8 sp=0x7fff7fe56e80 pc=0x557f13f8d0a5

runtime.(*mcache).refill(0x7efe2a58a108, 0x2a)

/usr/lib/golang/src/runtime/mcache.go:142 +0xa5 fp=0x7fff7fe56f18 sp=0x7fff7fe56ef8 pc=0x557f13f8ca45

runtime.(*mcache).nextFree(0x7efe2a58a108, 0x557f1776922a, 0x7efe2a58a108, 0xfffffffffffffff8, 0x7fff7fe56fa8)

/usr/lib/golang/src/runtime/malloc.go:880 +0x8d fp=0x7fff7fe56f50 sp=0x7fff7fe56f18 pc=0x557f13f8198d

runtime.mallocgc(0x180, 0x557f166a9b60, 0x7fff7fe57001, 0x7fff7fe57050)

/usr/lib/golang/src/runtime/malloc.go:1061 +0x854 fp=0x7fff7fe56ff0 sp=0x7fff7fe56f50 pc=0x557f13f82394

runtime.newobject(0x557f166a9b60, 0x557f13fda040)

/usr/lib/golang/src/runtime/malloc.go:1195 +0x3a fp=0x7fff7fe57020 sp=0x7fff7fe56ff0 pc=0x557f13f8283a

runtime.malg(0x8000, 0x0)

/usr/lib/golang/src/runtime/proc.go:3520 +0x33 fp=0x7fff7fe57060 sp=0x7fff7fe57020 pc=0x557f13fb6d73

runtime.mpreinit(0x557f177692e0)

/usr/lib/golang/src/runtime/os_linux.go:340 +0x2f fp=0x7fff7fe57080 sp=0x7fff7fe57060 pc=0x557f13fa8bef

runtime.mcommoninit(0x557f177692e0, 0xffffffffffffffff)

/usr/lib/golang/src/runtime/proc.go:663 +0xfa fp=0x7fff7fe570c8 sp=0x7fff7fe57080 pc=0x557f13fafeda

runtime.schedinit()

/usr/lib/golang/src/runtime/proc.go:565 +0xa5 fp=0x7fff7fe57120 sp=0x7fff7fe570c8 pc=0x557f13fafa65

runtime.rt0_go(0x7fff7fe57228, 0x4, 0x7fff7fe57228, 0x0, 0x7efe2978a0ba, 0x0, 0x7fff7fe57228, 0x400000000, 0x557f13fe39a0

, 0x0, ...)

/usr/lib/golang/src/runtime/asm_amd64.s:214 +0x129 fp=0x7fff7fe57128 sp=0x7fff7fe57120 pc=0x557f13fe3ae9: unknown

ERROR: Service 'web' failed to build : Build failed

답변 1

0

SungYong Lee님의 프로필 이미지
SungYong Lee
지식공유자

일단은 인스턴스를 리부트하고 다시 시도해보세요. 

현재 강좌에서 aws lightsail 인스턴스 메모리를 최소로 잡도록 가이드하고 있는데, 여유로운 상황은 아닙니다. 시도해보시고 안 되면 다시 알려주세요. 

성영창님의 프로필 이미지
성영창

작성한 질문수

질문하기