質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
docker-compose

docker-composeとは、複数のコンテナで構成されるサービスを提供する手順を自動的し管理を簡単にするツール。composeファイルを使用しコマンド1回で設定した全サービスを作成・起動することが可能です。

MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

バージョン管理

バージョン管理はコンピューター上にファイルとして格納されているドキュメント・プログラム・その他の情報の変更履歴等を管理するものです

Docker

Dockerは、Docker社が開発したオープンソースのコンテナー管理ソフトウェアの1つです

Q&A

1回答

1565閲覧

Docker [railsエラー]

退会済みユーザー

退会済みユーザー

総合スコア0

docker-compose

docker-composeとは、複数のコンテナで構成されるサービスを提供する手順を自動的し管理を簡単にするツール。composeファイルを使用しコマンド1回で設定した全サービスを作成・起動することが可能です。

MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

バージョン管理

バージョン管理はコンピューター上にファイルとして格納されているドキュメント・プログラム・その他の情報の変更履歴等を管理するものです

Docker

Dockerは、Docker社が開発したオープンソースのコンテナー管理ソフトウェアの1つです

0グッド

0クリップ

投稿2020/08/10 12:03

dockerの環境構築をしています。
しかし、下記のエラーにハマってなかなか解決できていない状況です。
railsの設定で何かしらエラーが起きている原因た管理者権限が付与されていない?のが原因だと思いますが、原因がわかる方いますでしょうか?

bundler: failed to load command: rails (/usr/local/bundle/bin/rails) web_1 | Errno::EPERM: Operation not permitted @ rb_sysopen - /aaaa/Gemfile web_1 | /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.6/lib/bundler/dsl.rb:528:in `read' web_1 | /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.6/lib/bundler/dsl.rb:528:in `contents' web_1 | /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.6/lib/bundler/dsl.rb:558:in `to_s' web_1 | /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.6/lib/bundler/setup.rb:12:in `message' web_1 | /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.6/lib/bundler/setup.rb:12:in `rescue in <top (required)>' web_1 | /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.6/lib/bundler/setup.rb:9:in `<top (required)>' web_1 | /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require' web_1 | /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'

Dockerfile

1FROM ruby:2.5.1 2RUN apt-get update && apt-get install -y \ 3 build-essential \ 4 nodejs 5WORKDIR /aaaa 6COPY Gemfile Gemfile.lock /aaaa/ 7RUN gem install bundler && bundle install 8COPY . /aaaa 9

docker

1version: '3' 2 3volumes: 4 mysql-data: 5 6services: 7 db: 8 image: mysql:5.7 9 environment: 10 MYSQL_USER: root 11 cap_add: 12 - SYS_ADMIN 13 security_opt: 14 - seccomp:unconfined 15 ports: 16 - "4306:3306" 17 volumes: 18 - ./db/mysql/volumes:/var/lib/mysql 19 20 web: 21 build: . 22 command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'" 23 ports: 24 - '3000:3000' 25 volumes: 26 - '.:/aaaa' 27 tty: true 28 stdin_open: true 29 depends_on: 30 - db

database.yml

1# MySQL. Versions 5.1.10 and up are supported. 2# 3# Install the MySQL driver 4# gem install mysql2 5# 6# Ensure the MySQL gem is defined in your Gemfile 7# gem 'mysql2' 8# 9# And be sure to use new-style password hashing: 10# https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html 11# 12default: &default 13 adapter: mysql2 14 encoding: utf8 15 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 16 username: root 17 password: 18 host: db 19 # socket: /tmp/mysql.sock 20 21development: 22 <<: *default 23 database: KStargram_development 24 25# Warning: The database defined as "test" will be erased and 26# re-generated from your development database when you run "rake". 27# Do not set this db to the same as development or production. 28test: 29 <<: *default 30 database: KStargram_test 31 32# As with config/secrets.yml, you never want to store sensitive information, 33# like your database password, in your source code. If your source code is 34# ever seen by anyone, they now have access to your database. 35# 36# Instead, provide the password as a unix environment variable when you boot 37# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database 38# for a full rundown on how to provide these environment variables in a 39# production deployment. 40# 41# On Heroku and other platform providers, you may have a full connection URL 42# available as an environment variable. For example: 43# 44# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" 45# 46# You can use this database configuration with: 47# 48# production: 49# url: <%= ENV['DATABASE_URL'] %> 50# 51production: 52 # <<: *default 53 adapter: postgresql 54 encoding: unicode 55 database: aaaa_production 56 username: aaaa 57 password: <%= ENV['AAAA_DATABASE_PASSWORD'] %> 58 pool: 5 59

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

推測なのですが、
WORKDIR /aaaaの一行の前に
RUN mkdir /aaaaが抜けてるように見えます。

WORKDIRはDocker上で作業のディレクトリを指定する命令ですが、
そもそもその作業をするディレクトリが作られていないのでは?と考えました。

見当違いでしたら申し訳ないです;;

投稿2020/08/15 08:11

kumackey

総合スコア59

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問