WSL2 + Docker Desktop for Windows does not launch only MySQL container

Only MySQL did not start with docker

Specifically, if you try to launch various containers with docker-compose up -d with ** WSL2 + Docker Desktop for Windows (+ Docker Compose) **, only the MySQL container (the latest version of 5.7) Did not stand up **

# docker-compose ps
            Name                           Command               State            Ports
------------------------------------------------------------------------------------------------
test-_back_1        /wait-for-it.sh mysql-db ...   Up       0.0.0.0:8080->8080/tcp
test-_front_1       /bin/sh -c envsubst '$$TES ...   Up       0.0.0.0:3000->80/tcp
test-_mysql-db_1   docker-entrypoint.sh mysqld      Exit 1

Take a look at the log

Check logs with docker-compose logs -f

log


mysql-db_1  | 2020-10-17 02:54:50+09:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
mysql-db_1  | 2020-10-17 02:54:50+09:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
mysql-db_1  | 2020-10-17 02:54:50+09:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
mysql-db_1  | 2020-10-17 02:54:50+09:00 [Note] [Entrypoint]: Initializing database files
mysql-db_1  | mysqld: [Warning] World-writable config file '/etc/mysql/conf.d/my.cnf' is ignored.
mysql-db_1  | 2020-10-16T17:54:50.236065Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mysql-db_1  | 2020-10-16T17:54:50.243510Z 0 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
mysql-db_1  | 2020-10-16T17:54:50.984126Z 0 [Warning] InnoDB: New log files created, LSN=****
mysql-db_1  | 2020-10-16T17:54:51.113491Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
mysql-db_1  | 2020-10-16T17:54:51.128211Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: ********
mysql-db_1  | 2020-10-16T17:54:51.133628Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
mysql-db_1  | mysqld: Can't change permissions of the file 'ca-key.pem' (Errcode: 1 - Operation not permitted)
mysql-db_1  | 2020-10-16T17:54:51.184562Z 0 [ERROR] Could not set file permission for ca-key.pem
mysql-db_1  | 2020-10-16T17:54:51.184583Z 0 [ERROR] Aborting
mysql-db_1  |

And finally

mysql-db_1  | 2020-10-16T17:54:51.184562Z 0 [ERROR] Could not set file permission for ca-key.pem
mysql-db_1  | 2020-10-16T17:54:51.184583Z 0 [ERROR] Aborting

It's big

Solutions

When I googled, I found the following issue

When I looked at it, there was a reply that it worked when I changed from ** mysql: 5.7 ** to ** mysql: 5.7.16 **, so I changed the version and it started working. (In my case, I wrote the version of MySQL in docker-compose.yml, so I changed it)

end

――Is it related to the authority to mount? It seems like, but I'm okay with this because I can move locally for the time being

Recommended Posts

WSL2 + Docker Desktop for Windows does not launch only MySQL container
Docker for Windows: MySQL container does not start when migrating from Hyper-v to WSL2
MySQL container does not start in Docker
Introducing Docker Desktop for Windows on WSL2
Operate Docker Desktop for Windows on Linux (WSL)
[Help] Docker for windows 2.3.0.4 without login Service startup method does not work [Help]
[Docker] Does not connect to MySQL workbench ... DB container port forwarding settings
How to start with Hyper-V instead of WSL2 on Docker Desktop for Windows
When Docker for Mac 2.4.0.0 does not reflect file changes
Docker does not work when DOCKER_HOST is specified in WSL2
Measures for permissions when building MySQL with Docker on WSL2
bundle install does not install mysql2
Response to WSL2 docker throwing an error after updating Docker for Windows
Try Oracle Enterprise Manager Cloud Control with Docker Desktop for Windows
[Personal memo] About button (GUI) operation of Docker Desktop for Windows
Docker Desktop WSL 2 backend Japanese translation
Using Docker on Windows10 Home WSL2
docker single container restart for myself
Container does not start with docker-compose
Run Redmine in the local environment of Windows10 Pro-Use Docker Desktop for Windows