Docker Toolboxでlaradockを動かそうとしたらmysqlが起動しない!
エラーメッセージでググったらこちらの記事がヒット。
https://qiita.com/lara_bell/items/d4bd1340a5cc7dfcfcb4
この記事を参考に修正したところ、今度は違うエラーが。
$ docker logs 2f9127b2dd11
Initializing database
2018-10-25T13:48:24.815150Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2018-10-25T13:48:24.815204Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2018-10-25T13:48:24.826043Z 0 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2018-10-25T13:48:25.379538Z 0 [ERROR] InnoDB: Operating system error number 22 in a file operation.
2018-10-25T13:48:25.379677Z 0 [ERROR] InnoDB: Error number 22 means 'Invalid argument'
2018-10-25T13:48:25.379721Z 0 [ERROR] InnoDB: File ./ib_logfile101: 'aio write' returned OS error 122. Cannot continue operation
2018-10-25T13:48:25.379756Z 0 [ERROR] InnoDB: Cannot continue operation.
再度エラーメッセージでググって解決方法を探したところ、docker-compose.ymlをいじれば良さそう。
mysql:
build:
context: ./mysql
args:
- MYSQL_VERSION=${MYSQL_VERSION}
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- TZ=${WORKSPACE_TIMEZONE}
volumes:
- ${DATA_PATH_HOST}/mysql:/var/lib/mysql
- ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
ports:
- "${MYSQL_PORT}:3306"
networks:
- backend
command: --innodb-use-native-aio=0 #コイツを追加!!!!!
一番最後のを追記したら無事動いた。