LoginSignup
1
2

More than 3 years have passed since last update.

dockerの起動中に起きたエラー

Posted at

railsアプリを立ち上げるためにdocker-compose buildを実行しようとすると次のエラーが出た。

$ docker-compose build
Building db
Step 1/4 : FROM mysql:8.0.17
 ---> b8fd9553f1f0
Step 2/4 : RUN apt-get update &&  apt-get install -y apt-utils
:
:
Fetching spring 2.0.2
Installing spring 2.0.2
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
  current directory: /usr/local/bundle/gems/nokogiri-1.10.9/ext/nokogiri
/usr/local/bin/ruby -r ./siteconf20200529-6-18ba5hy.rb extconf.rb
Cannot allocate memory - /usr/local/bin/ruby -r ./siteconf20200529-6-18ba5hy.rb
extconf.rb 2>&1
:
:
An error occurred while installing nokogiri (1.10.9), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.10.9' --source
'https://rubygems.org/'` succeeds before bundling.
:

nokogiri?
gemファイルに記述した覚えは無いが、、

エラー分にあるとおりnokogiriのインストールを試みたが、同様のエラーがでた。
$ gem install nokogiri -v '1.10.9'

調べると次の記事にあるように、容量不足によるエラーの可能性があるかもしれない。
https://qiita.com/HrsUed/items/c156ed69e927b6165717
記事通り容量を増加させたが、違うエラーが発生した。

$ docker-compose up -d
:
ERROR: Service 'web' failed to build: failed to register layer: Error processing tar file(exit status 1): write /usr/lib/x86_64-linux-gnu/libx265.so.165: no space left on device

エラーメッセージで調べると以下の記事が参考なった。
https://scrapbox.io/tsuchinaga/Docker%E3%81%A7%E5%AE%B9%E9%87%8F%E4%B8%8D%E8%B6%B3%E3%81%8C%E7%99%BA%E7%94%9F%E3%81%99%E3%82%8B
$ docker volume rm $(docker volume ls -qf dangling=true)

説明通りコマンドを実行するとbuildが成功した。

1
2
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
2