DockerのMariadbのコンテナがすぐに下記のログを吐き出し、コンテナが終了します。
exited with code 1
dbのログと関連するコードが下記です。
db_1 | 2021-07-03 03:34:44+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.4.17+maria~focal started. db_1 | 2021-07-03 03:34:46+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' db_1 | 2021-07-03 03:34:46+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.4.17+maria~focal started. db_1 | 2021-07-03 3:34:47 0 [Note] mysqld (mysqld 10.4.17-MariaDB-1:10.4.17+maria~focal-log) starting as process 1 ...
Dockerfile
FROM mariadb:10.4.17 RUN apt-get update && \ apt-get -y install locales-all ENV LANG ja_JP.UTF-8 ENV LANGUAGE ja_JP:ja ENV LC_ALL ja_JP.UTF-8 ENV TZ=UTC COPY /docker/mysql/my.cnf /etc/my.cnf
my.conf
[mysqld] explicit-defaults-for-timestamp= 1 character-set-server = utf8mb4 default-time-zone='Asia/Tokyo' log-error = mysql-error.log slow_query_log = 1 slow_query_log_file = mysql-slow.log long_query_time = 1.0 log_queries_not_using_indexes = 0 general_log = 1 general_log_file = mysql-general.log [mysql] default-character-set = utf8mb4 [client] default-character-set = utf8mb4
docker-compose.yml
db: container_name: sample_db build: context: . dockerfile: ./docker/mysql/Dockerfile command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci ports: - ${DB_PORT}:3306 volumes: - db-store:/var/lib/mysql - ./docker/mysql/initdb.d:/docker-entrypoint-initdb.d environment: - MYSQL_DATABASE=${DB_DATABASE} - MYSQL_USER=${DB_USERNAME} - MYSQL_PASSWORD=${DB_PASSWORD} - MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
.ebv
DB_PORT=3306 DB_DATABASE=sample_db DB_USERNAME=root DB_PASSWORD=password
ログにエラーらしきものもないので詰まっております。
ご教授よろしくお願いします。
あなたの回答
tips
プレビュー