Merge ~valentinviennot/ubuntu-docker-images:update-mysql-readme into ~ubuntu-docker-images/ubuntu-docker-images/+git/mysql:edge

Proposed by Valentin Viennot
Status: Merged
Merged at revision: 5da174f0239d89e4fa6037e082bef85e163f1ba7
Proposed branch: ~valentinviennot/ubuntu-docker-images:update-mysql-readme
Merge into: ~ubuntu-docker-images/ubuntu-docker-images/+git/mysql:edge
Diff against target: 85 lines (+15/-26)
1 file modified
README.md (+15/-26)
Reviewer Review Type Date Requested Status
Sergio Durigan Junior Needs Fixing
Richard Harding Pending
Review via email: mp+393879@code.launchpad.net

Description of the change

Did some cleaning work and consistency against the last version of the Redis README.

To post a comment you must log in.
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks for the MP. There's just one very small nit, but otherwise everything is great. Let me know when you address it and I can merge your branch.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/README.md b/README.md
2index 490268e..46a6f2d 100644
3--- a/README.md
4+++ b/README.md
5@@ -5,7 +5,7 @@
6 MySQL is a fast, stable and true multi-user, multi-threaded SQL database
7 server. SQL (Structured Query Language) is the most popular database query
8 language in the world. The main goals of MySQL are speed, robustness and ease
9-of use.
10+of use. Read more on the [MySQL website](https://dev.mysql.com/doc/refman/8.0/en/).
11
12 ## Tags
13
14@@ -20,34 +20,26 @@ of use.
15 ### Docker CLI
16
17 ```sh
18-$ docker network create mysql-net
19-# Run the server
20-$ docker run --name mysql-instance --network mysql-net --env MYSQL_ROOT_PASSWORD=My$seCret --detach squeakywheel/mysql:edge
21-# Run the client
22-$ docker run --interactive --tty --rm --network mysql-net squeakywheel/mysql:edge mysql -hmysql-instance -Uroot -p
23-```
24-
25-The password will be asked and you can enter `My$seCret`. Now, you are logged in and can enjoy your new instance.
26-
27-Since containers are ephemeral you might be interested in persist data and not initialize a new database every time you launch a new container. To do that you can use docker volumes:
28-
29-```sh
30-$ docker run --name mysql --volume /path/to/persisted/data:/var/lib/mysql --env MYSQL_RANDOM_ROOT_PASSWORD=yes squeakywheel/mysql:edge
31+$ docker network create --driver bridge mysql-net
32+$ docker run -d --name mysql-instance --network mysql-net -e TZ=Europe/London -e MYSQL_ROOT_PASSWORD=My:S3cr3t/ squeakywheel/mysql:edge
33 ```
34
35 #### Parameters
36
37 | Parameter | Description |
38 |---|---|
39-| `-e TZ=UTC` | Timezone |
40+| `-e TZ=UTC` | Timezone. |
41 | `-e MYSQL_ROOT_PASSWORD=secret_for_root` | Set the password for the `root` user. This option is **mandatory** and **must not be empty**. |
42 | `-e MYSQL_PASSWORD=secret` | Set the password for the `MYSQL_USER` user. |
43-| `-e MYSQL_USER=john` | Create a new user with superuser privileges. This is used in conjunction with `MYSQL_PASSWORD` |
44+| `-e MYSQL_USER=john` | Create a new user with superuser privileges. This is used in conjunction with `MYSQL_PASSWORD`. |
45 | `-e MYSQL_DATABASE=db_test` | Set the name of the default database. |
46 | `-e MYSQL_ALLOW_EMPTY_PASSWORD=yes` | Set up a blank password for the `root` user. **This is not recommended to be used in production, make sure you know what you are doing**. |
47 | `-e MYSQL_RANDOM_ROOT_PASSWORD=yes` | Generate a random initial password for the `root` user using `pwgen`. It will be printed in the logs, search for `GENERATED ROOT PASSWORD`. |
48 | `-e MYSQL_ONETIME_PASSWORD=yes` | Set `root` user as experide once initialization is complete, forcing a password change on first login. |
49-| `-e MYSQL_INITSB_SKIP_TZINFO=yes` | Timezone data is automatically loaded via entrypoint script, set this variable to any non-empty value to disable it. |
50+| `-e MYSQL_INITSB_SKIP_TZINFO=yes` | Timezone data is automatically loaded via entrypoint script, set this variable to any non-empty value to disable it. |
51+| `-p 30306:3306` | Expose MySQL server on `localhost:30306`. |
52+| `-v /path/to/data:/var/lib/mysql` | Persist data instead of initializing a new database every time you launch a new container |
53+| `-v /path/to/config/files/:/etc/mysql/mysql.conf.d/` | Pass your own [configuration files](https://dev.mysql.com/doc/refman/8.0/en/mysql-command-options.html) to the container. |
54
55 #### Initialization Scripts
56
57@@ -59,23 +51,20 @@ One can also add initialization scripts to their containers. This includes `*.sq
58
59 All of this is done before the MySQL service is started. Keep in mind if your database directory is not empty (contains pre-existing database) they will be left untouched.
60
61-#### Database Configuration
62+#### Testing/Debugging
63
64-You can pass your own configuration files to the container doing the following:
65+In case you need to debug what it is happening with the container you can run `docker logs <name_of_the_container>`. But if you want to get access to an interactive shell run:
66
67 ```sh
68-$ docker run --name mysql --volume /path/to/mysql/config/files/:/etc/mysql/mysql.conf.d/ --env MYSQL_ROOT_PASSWORD=P@sSwd squeakywheel/mysql:edge
69+$ docker exec -it <name_of_the_container> /bin/bash
70 ```
71
72-#### Debugging
73-
74-In case you need to debug what it is happening with the container you can run `docker logs <name_of_the_container>`. But if you want to get access to an interactive shell run:
75+With this same image, you can launch an interactive container as a client to connect to your `mysql` server running in the first container.
76
77 ```sh
78-$ docker exec -it <name_of_the_container> /bin/bash
79+$ docker run -it --rm --network mysql-net squeakywheel/mysql:edge mysql -hmysql-instance -uroot -p
80 ```
81-
82-To see how to use the MySQL OCI image with `docker-compose` and `kubernetes` check the `examples/README.md` file.
83+The password will be asked and you can enter `My:S3cr3t/`. Now, you are logged in and can enjoy your new instance.
84
85 ## Deploy with Kubernetes
86

Subscribers

People subscribed via source and target branches