GCE(f1-micro)의 docker-compose에서 Cannot allocate memory

배경



GCP(Google Cloud Platform) 좋네요! AWS보다 취약하기 때문에 최근 자주 사용하고 있습니다.
그 중에 GCE라는 ssh 연결할 수있는 컴퓨팅 리소스가 있지만 무료 프레임의 f1-micro에서
아래의 GitHub 내용을 docker-compose up 했는데 아래의 에러가 나왔기 때문에 공유입니다!
htps : // 기주 b. 코 m / 코요 미야 무라 / ㅁ Stg 등 m

덧붙여서 f1.micro의 스펙은 이쪽


오류 내용



Installing ffi 1.9.25 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /usr/local/bundle/gems/ffi-1.9.25/ext/ffi_c
/usr/local/bin/ruby -r ./siteconf20180729-6-5nocr2.rb extconf.rb
Cannot allocate memory - /usr/local/bin/ruby -r ./siteconf20180729-6-5nocr2.rb
extconf.rb 2>&1


오류 메시지 전체 텍스트(클릭으로 확장)
Building web
Step 1/6 : FROM ruby:2.5.1
 ---> 1d8640b852eb
Step 2/6 : WORKDIR /app
 ---> Using cache
 ---> 2b92751173b0
Step 3/6 : ADD Gemfile /app/Gemfile
 ---> Using cache
 ---> 64d4e0189481
Step 4/6 : ADD Gemfile.lock /app/Gemfile.lock
 ---> Using cache
 ---> c0a4503d04ac
Step 5/6 : RUN bundle install
 ---> Running in 15c608884196
Fetching gem metadata from https://rubygems.org/..........
Using bundler 1.16.3
Fetching ffi 1.9.25
Installing ffi 1.9.25 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /usr/local/bundle/gems/ffi-1.9.25/ext/ffi_c
/usr/local/bin/ruby -r ./siteconf20180729-6-5nocr2.rb extconf.rb
Cannot allocate memory - /usr/local/bin/ruby -r ./siteconf20180729-6-5nocr2.rb
extconf.rb 2>&1

Gem files will remain installed in /usr/local/bundle/gems/ffi-1.9.25 for
inspection.
Results logged to
/usr/local/bundle/extensions/x86_64-linux/2.5.0/ffi-1.9.25/gem_make.out

An error occurred while installing ffi (1.9.25), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.25' --source 'https://rubygems.org/'`
succeeds before bundling.

In Gemfile:
  rerun was resolved to 0.13.0, which depends on
    listen was resolved to 3.1.5, which depends on
      rb-inotify was resolved to 0.9.10, which depends on
        ffi
ERROR: Service 'web' failed to build: The command '/bin/sh -c bundle install' returned a non-zero code: 5



해결책



에러 메세지 잘 보면 메모리가 부족하다고 알려져 있으므로, (유료가 되어 버립니다만) g1-small 로 하면 움직였습니다!

유석에 메모리 600MB는 한계 있는 장면도 나오는 것 같네요 >>

좋은 웹페이지 즐겨찾기