LoginSignup
1
0

More than 5 years have passed since last update.

GCE(f1-micro)のdocker-composeでCannot allocate memory

Last updated at Posted at 2018-08-05

背景

GCP(Google Cloud Platform)いいですよね!AWSより取っつきやすいので最近よく使っています。
その中にGCEというssh接続できるコンピューティングリソースあるんですが、無料枠のf1-microで
以下のGitHubの内容をdocker-compose upしたところ以下のエラーが出たのでシェアです!
https://github.com/koyo-miyamura/latestgram

ちなみにf1.microのスペックはこちら
image.png

エラー内容


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は限界ある場面も出てくるみたいですね><

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0