$ docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql
works fine. But If I try to map port to host (even after purging the image):
$ docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql -p 3306:3306
it exits immediately. Logs:
sudo docker logs some-mysql
ERROR: mysqld failed while attempting to check config
command was: "mysqld -p 3306:3306 --verbose --help"
Enter password: mysqld: Can not perform keyring migration : Invalid --keyring-migration-source option.
2018-10-10T21:07:32.296550Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2018-10-10T21:07:32.299708Z 0 [ERROR] [MY-011084] [Server] Keyring migration failed.
2018-10-10T21:07:32.302023Z 0 [ERROR] [MY-010119] [Server] Aborting
$ uname -a
Linux red 4.18.0-2-amd64 #1 SMP Debian 4.18.10-1 (2018-09-30) x86_64 GNU/Linux
$ docker --version
Docker version 18.06.1-ce, build e68fc7a
Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
Your -p option is in the arguments section of the command
$ docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d -p 3306:3306 mysql
$ docker exec -it some-mysql bash
root@aa80ce49aa75:/# mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.12 MySQL Community Server - GPL
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
The entrypoint passed your argument to mysqld https://github.com/docker-library/mysql/blob/b39f1e5e4ec82dc8039cecc91dbf34f6c9ae5fb0/8.0/docker-entrypoint.sh#L5-L8
Silly mistake, thanks
Most helpful comment
Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
Your
-poption is in the arguments section of the commandThe entrypoint passed your argument to mysqld https://github.com/docker-library/mysql/blob/b39f1e5e4ec82dc8039cecc91dbf34f6c9ae5fb0/8.0/docker-entrypoint.sh#L5-L8