- We unfortunately are still on MySQL 5.7. ENG-111 tracks moving to a recent version of MariaDB
- I am purposefully deferring the question of persistence/volumes here, which is tracked in ENG-1069. I need to read up on the subject first, and also I'll probably (maybe?) want to make Redis persist as well
Details
Run docker-compose up --build
Diff Detail
- Repository
- rCOMM Comm
- Branch
- ashoat/dockerize_node
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
keyserver/docker-compose.yml | ||
---|---|---|
16 | Note that I'm purposefully deferring the question of volumes / persistence – see diff description |
keyserver/docker-compose.yml | ||
---|---|---|
25 | why do we need to set MYSQL_RANDOM_ROOT_PASSWORD if it defaults to true? |
Interesting... you linked a docs page I hadn't seen before, but seems quite relevant (Docker config for MySQL 5.7).
That said – when I leave this config out I get this error:
keyserver-database-1 | 2022-05-02 19:48:55+00:00 [ERROR] [Entrypoint]: Database is uninitialized and password option is not specified keyserver-database-1 | You need to specify one of the following: keyserver-database-1 | - MYSQL_ROOT_PASSWORD keyserver-database-1 | - MYSQL_ALLOW_EMPTY_PASSWORD keyserver-database-1 | - MYSQL_RANDOM_ROOT_PASSWORD
Accepting, but have one q: is the root user prompted to reset their password before MySQL can be used normally or will they have to find the random password in the container logs if they need to access the server?
The docs explain that the password is printed to logs:
The password is printed to stdout of the container and can be found by looking at the container’s log (see Starting a MySQL Server Instance).
Looking at the logs from running docker-compose up --build, I think this is the line:
2022-05-03 16:09:52+00:00 [Note] [Entrypoint]: GENERATED ROOT PASSWORD: R0zD6xFYD9ep+wueozyXW5P3kzYefnx2
When I boot the container using docker-compose up --build, and connect to it in another terminal using docker exec -it keyserver-database-1 /bin/bash, I am able to access MySQL inside the container using mysql -uroot -p while using the generated root password, without MySQL prompting me to change it.