railsでDokerfileを設定しているのですが、railsが起動してくれません。
参考記事をみながら、docker start コンテナ名を実行してもコンテナが起動しない状況となっています。
Dockerfile
1FROM ruby:2.5.8 2RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs 3 4RUN mkdir /aaaa 5WORKDIR /aaaa 6 7ADD Gemfile /aaaa/Gemfile 8 9 10RUN gem update bundler && bundle install --path vendor/bundle 11CMD ["rails", "server", "-b", "0.0.0.0"]
docker
1version: '3' 2services: 3 db: 4 image: mysql:5.6 5 environment: 6 MYSQL_USER: root 7 MYSQL_ROOT_PASSWORD: password 8 ports: 9 - "4306:3306" 10 11 web: 12 build: . 13 command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'" 14 volumes: 15 - .:/aaaa 16 environment: 17 BUNDLE_APP_CONFIG: /aaaa/vendor/bundle 18 ports: 19 - "3000:3000" 20 depends_on: 21 - db 22 privileged: true 23 tty: true 24 stdin_open: true 25volumes: 26 bundle_install: 27 driver: local
エラー内容は以下のものになります。
web_1 | Traceback (most recent call last): web_1 | 9: from /usr/local/bundle/bin/bundle:23:in `<main>' web_1 | 8: from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems.rb:302:in `activate_bin_path' web_1 | 7: from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems.rb:272:in `find_spec_for_exe' web_1 | 6: from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/dependency.rb:284:in `matching_specs' web_1 | 5: from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/bundler_version_finder.rb:45:in `filter!' web_1 | 4: from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/bundler_version_finder.rb:7:in `bundler_version' web_1 | 3: from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/bundler_version_finder.rb:22:in `bundler_version_with_reason' web_1 | 2: from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/bundler_version_finder.rb:68:in `lockfile_version' web_1 | 1: from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/bundler_version_finder.rb:96:in `lockfile_contents' web_1 | /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/bundler_version_finder.rb:96:in `read': Operation not permitted @ rb_sysopen - /aaaa/Gemfile.lock (Errno::EPERM) web_1 | aaaa_web_1 exited with code 1
Gemfileの権限か何かでしょうが原因が全く理解できない現状です。
何かご存知の方いないでしょうか?
あなたの回答
tips
プレビュー