LoginSignup
28
37

More than 3 years have passed since last update.

Docker x Laravel phpMyAdmin のコンテナを構築する

Last updated at Posted at 2020-09-22

以前の記事(最強のLaravel開発環境をDockerを使って構築する【新編集版】)のコメントにてphpMyAdminを使用したいという要望がありましたので補足の記事を作成させていただきます。

手順

docker-compose.yml に phpMyAdmin のサービスを追加

docker-compose.yml
volumes:
  # 追記
  pma-session-store:

services:
  # 追記
  pma:
    image: phpmyadmin/phpmyadmin
    environment:
      - PMA_HOST=db
      - PMA_USER=phper
      - PMA_PASSWORD=secret
    ports:
      - 8080:80
    volumes:
      - pma-session-store:/sessions

Dockerコンテナの構築

$ docker-compose up -d

phpMyAdmin へアクセス

上記のURLへアクセスし、phpMyAdminの画面が表示されればokです。

ScreenShot 2020-09-22 19.11.42.png

ScreenShot 2020-09-22 19.11.46.png

補足

MySQL新認証プラグイン caching_sha2_password

私のdbコンテナの設定でMySQL8.0系で認証方式を新しいcaching_sha2_passwordに設定しています。phpMyAdminは5.0.1以降でないとcaching_sha2_passwordに対応していないのでタグで新しいバージョンを明示的に指定してます。latestが5系を指すようになったら外してもいいかもです。

蛇足

(MySQLのCLIやSequel Ace等のクライアントツールで特に不便がないのでがあるので個人的にはphpMyAdminは入れなくてもいいかなと思ってます)

28
37
7

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
28
37