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

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

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

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

Ruby on Rails 6

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

データベース

データベースとは、データの集合体を指します。また、そのデータの集合体の共用を可能にするシステムの意味を含めます

Docker

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

Q&A

解決済

1回答

1551閲覧

Dockerでデータベースの作成ができない

tomsuma

総合スコア38

docker-compose

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

Ruby on Rails 6

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

データベース

データベースとは、データの集合体を指します。また、そのデータの集合体の共用を可能にするシステムの意味を含めます

Docker

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

0グッド

0クリップ

投稿2020/09/03 09:35

編集2020/09/03 10:55

Docker初心者です

docker-compose run web bundle exec rake db:create
するとこのようにエラーが出ます

ERROR: pull access denied for mysql2, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

docker login
は成功するのに何故か作れません。

リポジトリも作成しているのになぜでしょうかイメージ説明

user@fukusyun-2 Books % docker-compose run web bundle exec rake db:create Pulling db (mysql2:0.4.4)... ERROR: pull access denied for mysql2, repository does not exist or may require 'docker login': denied: requested access to the resource is denied user@fukusyun-2 Books % docker login Authenticating with existing credentials... Login Succeeded
user@fukusyun-2 Books % docker search registry NAME DESCRIPTION STARS OFFICIAL AUTOMATED registry The Docker Registry 2.0 implementation for s… 3066 [OK] distribution/registry WARNING: NOT the registry official image!!! … 57 [OK] stefanscherer/registry-windows Containerized docker registry for Windows Se… 32 budry/registry-arm Docker registry build for Raspberry PI 2 and… 18 deis/registry Docker image registry for the Deis open sour… 12 jc21/registry-ui A nice web interface for managing your Docke… 12 anoxis/registry-cli You can list and delete tags from your priva… 10 [OK] allingeek/registry A specialization of registry:2 configured fo… 4 [OK] pallet/registry-swift Add swift storage support to the official do… 4 [OK] arm32v6/registry The Docker Registry 2.0 implementation for s… 3 goharbor/registry-photon 2 webhippie/registry Docker images for Registry 1 [OK] conjurinc/registry-oauth-server Docker registry authn/authz server backed by… 1 ibmcom/registry Docker Image for IBM Cloud private-CE (Commu… 1 concourse/registry-image-resource 1 metadata/registry Metadata Registry is a tool which helps you … 1 [OK] upmcenterprises/registry-creds 0 kontena/registry Kontena Registry 0 dwpdigital/registry-image-resource Concourse resource type 0 gisjedi/registry-proxy Reverse proxy of registry mirror image gisje… 0 lorieri/registry-ceph Ceph Rados Gateway (and any other S3 compati… 0 convox/registry 0 digillect/registry-cleaner Tool to remove unused images from Docker reg… 0 [OK] pivnet/registry-gcloud-image 0 deepsecurity/registryviews Deep Security Smart Check 0
webpacker.yml # Note: You must restart bin/webpack-dev-server for changes to take effect default: &default source_path: app/javascript source_entry_path: packs public_root_path: public public_output_path: packs cache_path: tmp/cache/webpacker check_yarn_integrity: false ここでエラー webpack_compile_output: true # Additional paths webpack should lookup modules # ['app/assets', 'engine/foo/app/assets'] resolved_paths: [] # Reload manifest.json on all requests so we reload latest compiled packs cache_manifest: false # Extract and emit a css file extract_css: false static_assets_extensions: - .jpg - .jpeg - .png - .gif - .tiff - .ico - .svg - .eot - .otf - .ttf - .woff - .woff2 extensions: - .mjs - .js - .sass - .scss - .css - .module.sass - .module.scss - .module.css - .png - .svg - .gif - .jpeg - .jpg development: <<: *default compile: true # Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules check_yarn_integrity: true # Reference: https://webpack.js.org/configuration/dev-server/ dev_server: https: false host: localhost port: 3035 public: localhost:3035 hmr: false # Inline should be set to true if using HMR inline: true overlay: true compress: true disable_host_check: true use_local_ip: false quiet: false pretty: false headers: 'Access-Control-Allow-Origin': '*' watch_options: ignored: '**/node_modules/**' test: <<: *default compile: true # Compile test packs to a separate directory public_output_path: packs-test production: <<: *default # Production depends on precompilation of packs prior to booting for performance. compile: false # Extract and emit a css file extract_css: true # Cache manifest.json for performance cache_manifest: true
web_1 | => Booting Puma web_1 | => Rails 6.0.3.2 application starting in development web_1 | => Run `rails server --help` for more startup options web_1 | sh: 1: yarn: not found web_1 | web_1 | web_1 | ======================================== web_1 | Your Yarn packages are out of date! web_1 | Please run `yarn install --check-files` to update. web_1 | ======================================== web_1 | web_1 | web_1 | To disable this check, please change `check_yarn_integrity` web_1 | to `false` in your webpacker config file (config/webpacker.yml). web_1 | web_1 | web_1 | web_1 | web_1 | web_1 | Exiting books_web_1 exited with code 1

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

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

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

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

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

guest

回答1

0

ベストアンサー

docker-compose.yml で次のように定義していませんか?

yaml

1services: 2 db: 3 image: mysql2:0.4.4

もし上記のように定義している場合、
Docker Hub には mysql2 というイメージは公開されていません

もし、MySQL のコンテナーを起動したいのであれば、
例えば次のように記述します:

yaml

1services: 2 db: 3 command: --default-authentication-plugin=mysql_native_password 4 restart: always 5 environment: 6 MYSQL_ROOT_PASSWORD: example 7 image: mysql

参考: mysql - Docker Hub

詳しい mysql イメージの使い方は、上記参考の公式の解説を参照します

投稿2020/09/03 10:23

y_shinoda

総合スコア3272

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

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

tomsuma

2020/09/03 10:57

ご回答ありがとうございます また違うエラーに悩んでいます docker-compose up をするとどうしてもエラーが起きてしまいます
tomsuma

2020/09/03 11:02

yarn upgradeもしてます
y_shinoda

2020/09/03 11:06

内容が完全に別の問題なので、新たに質問を投稿お願いします 新たに質問を投稿すると次のようなメリットがあります: - 質問者も回答者も新たにポイントを取得できます - すべての回答者が質問を確認し、回答が得られる確率が上がります - 検索でこの質問にたどり着いた人が質問のタイトルに対するシンプルな回答を得ることができ、質問に高評価が得られやすくなります
tomsuma

2020/09/03 11:32

そうなんですね 使い始めて一ヶ月立っていないのでよくわかっていませんでした。、、 ありがとうございます。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問