CircleCIでMySQLのイメージがビルドされない
現在Laravelでアプリケーションを作っています。そのアプリのテストを自動化しようとCircleCIを導入したのですが、その際にエラーにハマってしまったので質問させてください。
具体的にどのような問題が発生しているかというと、circleciの設定ファイルに書いた、MySQLのイメージがビルドされないというものです。MySQLのイメージをビルドしている際のLogは以下の通りです。
発生している問題・エラーメッセージ
テストを実行すると、MySQLのイメージのビルドがキャンセルされてしまいます。
2020-10-21 10:28:23+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.21-1debian10 started. 2020-10-21 10:28:23+00:00 [Note] [Entrypoint]: Initializing database files 2020-10-21T10:28:23.704088Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.21) initializing of server in progress as process 73 2020-10-21T10:28:23.705307Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. 2020-10-21T10:28:23.705319Z 0 [Warning] [MY-013244] [Server] --collation-server: 'utf8_unicode_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. 2020-10-21T10:28:23.711279Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2020-10-21T10:28:23.946407Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2020-10-21T10:28:24.720528Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option. 2020-10-21 10:28:26+00:00 [Note] [Entrypoint]: Database files initialized 2020-10-21 10:28:26+00:00 [Note] [Entrypoint]: Starting temporary server mysqld will log errors to /var/lib/mysql/4b2586f26e24.err mysqld is running as pid 178 2020-10-21 10:28:26+00:00 [Note] [Entrypoint]: Temporary server started. Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it. Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it. Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it. Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it. 2020-10-21 10:28:28+00:00 [Note] [Entrypoint]: Creating database bookshelf 2020-10-21 10:28:28+00:00 [Note] [Entrypoint]: Creating user default 2020-10-21 10:28:28+00:00 [Note] [Entrypoint]: Giving user default access to schema bookshelf 2020-10-21 10:28:28+00:00 [Note] [Entrypoint]: Stopping temporary server 2020-10-21 10:28:30+00:00 [Note] [Entrypoint]: Temporary server stopped 2020-10-21 10:28:30+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up. 2020-10-21T10:28:30.517867Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.21) starting as process 8 2020-10-21T10:28:30.520304Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. 2020-10-21T10:28:30.520320Z 0 [Warning] [MY-013244] [Server] --collation-server: 'utf8_unicode_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. 2020-10-21T10:28:30.526812Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2020-10-21T10:28:30.672751Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2020-10-21T10:28:30.750389Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock 2020-10-21T10:28:30.843018Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. 2020-10-21T10:28:30.843186Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel. 2020-10-21T10:28:30.844994Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory. 2020-10-21T10:28:30.860565Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.21' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL. Build was canceled
該当のソースコード
CircleCIの設定ファイルは以下の通りです。
version: 2 jobs: build: docker: # Specify the version you desire here - image: circleci/php:7.3-node-browsers - image: circleci/mysql:8.0.21 environment: MYSQL_DATABASE: bookshelf MYSQL_USER: default MYSQL_PASSWORD: secret environment: APP_ENV: testing DB_CONNECTION: mysql DB_HOST: mysql DB_PORT: 3306 DB_DATABASE: bookshelf DB_USERNAME: default DB_PASSWORD: secret steps: - checkout - restore_cache: key: composer-v1-{{ checksum "composer.lock" }} - run: composer install -n --prefer-dist - save_cache: key: composer-v1-{{ checksum "composer.lock" }} paths: - vendor - restore_cache: key: npm-v1-{{ checksum "package-lock.json" }} - run: name: npm ci command: | if [ ! -d node_modules ]; then npm ci fi - save_cache: key: npm-v1-{{ checksum "package-lock.json" }} paths: - node_modules - run: npm run dev - run: name: get ready for mysql command: | sudo apt-get update sudo docker-php-ext-install pdo_mysql dockerize -wait tcp://localhost:3306 -timeout 2m - run: name: php test command: vendor/bin/phpunit
試したこと
Logに目を通して見たのですが、どこが原因でビルドがキャンセルされてしまうのかがわかりません。どこが原因でビルドがキャンセルされてしまうのかご指摘いただければ幸いです。
補足情報(FW/ツールのバージョンなど)
####開発環境
macOS ver 10.14.5
Laravel Framework 6.18.42
PHP 7.3.22
Laradockで環境構築をしています。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。