Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit caa66b6

Browse files
authored
Merge pull request #268 from jdeathe/centos-7-mysql57-community-develop
Release changes for 2.3.1
2 parents a12d982 + a39b658 commit caa66b6

File tree

7 files changed

+216
-180
lines changed

7 files changed

+216
-180
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
Summary of release changes.
66

7+
### 2.3.1 - 2019-08-23
8+
9+
- Updates healthcheck script for consistency.
10+
- Fixes container mount point for emulating and testing secrets.
11+
- Fixes issue with automatically generated root password initialisation when running with existing datadir volume.
12+
713
### 2.3.0 - 2019-07-09
814

915
- Updates source image to [2.6.0](https://github.com/jdeathe/centos-ssh/releases/tag/2.6.0).

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM jdeathe/centos-ssh:2.6.0
22

3-
ARG RELEASE_VERSION="2.3.0"
3+
ARG RELEASE_VERSION="2.3.1"
44

55
# ------------------------------------------------------------------------------
66
# Base install of required packages

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Tags and respective `Dockerfile` links
22

3-
- `centos-7-mysql57-community`, [`2.3.0`](https://github.com/jdeathe/centos-ssh-mysql/tree/2.3.0) [(centos-7-mysql57-community/Dockerfile)](https://github.com/jdeathe/centos-ssh-mysql/blob/centos-7-mysql57-community/Dockerfile)
4-
- `centos-6`, [`1.11.0`](https://github.com/jdeathe/centos-ssh-mysql/tree/1.11.0) [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh-mysql/blob/centos-6/Dockerfile)
3+
- `centos-7-mysql57-community`, [`2.3.1`](https://github.com/jdeathe/centos-ssh-mysql/tree/2.3.1) [(centos-7-mysql57-community/Dockerfile)](https://github.com/jdeathe/centos-ssh-mysql/blob/centos-7-mysql57-community/Dockerfile)
4+
- `centos-6`, [`1.11.1`](https://github.com/jdeathe/centos-ssh-mysql/tree/1.11.1) [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh-mysql/blob/centos-6/Dockerfile)
55

66
## Overview
77

@@ -25,7 +25,7 @@ $ docker run -d \
2525
--name mysql.1 \
2626
-p 3306:3306 \
2727
-v /var/lib/mysql \
28-
jdeathe/centos-ssh-mysql:2.3.0
28+
jdeathe/centos-ssh-mysql:2.3.1
2929
```
3030

3131
Verify the named container's process status and health.
@@ -60,11 +60,11 @@ $ docker exec -it \
6060
mysql.1 \
6161
mysql
6262
```
63-
### Sakila Example
63+
### Sakila example
6464

6565
Import the Sakila example database from the [MySQL Documentation](https://dev.mysql.com/doc/index-other.html) and view the first 2 records from the film table.
6666

67-
#### Import Schema
67+
#### Import schema
6868

6969
```
7070
$ docker exec -i mysql.1 mysql \
@@ -74,7 +74,7 @@ $ docker exec -i mysql.1 mysql \
7474
)
7575
```
7676

77-
#### Import Data
77+
#### Import data
7878

7979
```
8080
$ docker exec -i mysql.1 mysql \
@@ -83,7 +83,7 @@ $ docker exec -i mysql.1 mysql \
8383
)
8484
```
8585

86-
#### Select Records
86+
#### Select records
8787

8888
```
8989
$ docker exec mysql.1 mysql \
@@ -104,7 +104,7 @@ The following example sets up a custom MySQL database, user and user password on
104104

105105
```
106106
$ docker stop mysql.1 && \
107-
docker rm mysql.1 && \
107+
docker rm mysql.1; \
108108
docker run \
109109
--detach \
110110
--name mysql.1 \
@@ -114,7 +114,7 @@ $ docker stop mysql.1 && \
114114
--env "MYSQL_USER_PASSWORD=" \
115115
--env "MYSQL_USER_DATABASE=app-db" \
116116
--volume mysql.1.data-mysql:/var/lib/mysql \
117-
jdeathe/centos-ssh-mysql:2.3.0
117+
jdeathe/centos-ssh-mysql:2.3.1
118118
```
119119

120120
The environmental variable `MYSQL_SUBNET` is optional but can be used to generate users with access to databases outside the `localhost`, (the default for the root user). In the example, the subnet definition `0.0.0.0/0.0.0.0` allows connections from any network which is equivalent to the wildcard symbol, `%`, in MySQL GRANT definitions.
@@ -125,7 +125,7 @@ Verify it's initialised and running successfully by inspecting the container's l
125125
$ docker logs mysql.1
126126
```
127127

128-
#### Environment Variables
128+
#### Environment variables
129129

130130
There are several environmental variables defined at runtime these allow the operator to customise the running container.
131131

src/etc/supervisord.d/20-mysqld-bootstrap.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ autorestart = false
33
autostart = %(ENV_ENABLE_MYSQLD_BOOTSTRAP)s
44
command = /usr/sbin/mysqld-bootstrap --verbose
55
priority = 20
6-
startsecs = 0
76
startretries = 0
7+
startsecs = 0
88
stderr_logfile = /dev/stderr
99
stderr_logfile_maxbytes = 0
1010
stdout_logfile = /dev/stdout

src/usr/bin/healthcheck

+18-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
set -e
4+
35
function __get_system_timezone ()
46
{
57
local -r default_value="${1:-UTC}"
@@ -97,14 +99,14 @@ function __last_check_passed ()
9799
{
98100
local -i status=0
99101

100-
if [[ ! -f ${STATUS_PATH} ]]
102+
if [[ ! -f ${status_path} ]]
101103
then
102104
return ${status}
103105
else
104106
read \
105107
-n 1 \
106108
status \
107-
< "${STATUS_PATH}"
109+
< "${status_path}"
108110

109111
if [[ ${status} =~ ^[01]$ ]]
110112
then
@@ -130,8 +132,9 @@ function __mysql_get_option ()
130132

131133
function __print_message ()
132134
{
135+
local -r quiet="${quiet:-false}"
133136
local -r type="${1:-}"
134-
local -r quiet="${QUIET:-false}"
137+
135138
local message="${2:-}"
136139
local prefix
137140

@@ -168,10 +171,9 @@ function __print_message ()
168171

169172
function __record_exit_status ()
170173
{
174+
local -r status_directory="${status_path%/*}"
175+
171176
local -i status=${1:-${?}}
172-
local status_directory="$(
173-
dirname "${STATUS_PATH}"
174-
)"
175177

176178
if [[ ! -d ${status_directory} ]]
177179
then
@@ -183,20 +185,20 @@ function __record_exit_status ()
183185
"${status_directory}"
184186
fi
185187

186-
if [[ ! -f ${STATUS_PATH} ]]
188+
if [[ ! -f ${status_path} ]]
187189
then
188190
install \
189191
-m 0660 \
190192
-o root \
191193
-g root \
192194
/dev/null \
193-
"${STATUS_PATH}"
195+
"${status_path}"
194196
fi
195197

196198
printf -- \
197199
'%d' \
198200
"${status}" \
199-
> "${STATUS_PATH}"
201+
> "${status_path}"
200202

201203
trap - \
202204
EXIT
@@ -208,8 +210,8 @@ function __usage ()
208210
{
209211
cat <<-USAGE
210212
211-
Usage: $(basename ${0}) [OPTIONS]
212-
$(basename ${0}) [-h|--help]
213+
Usage: ${0##*/} [OPTIONS]
214+
${0##*/} [-h|--help]
213215
214216
Options:
215217
-i, --interval=<seconds> After the first successful check the
@@ -228,18 +230,18 @@ function __usage ()
228230

229231
function main ()
230232
{
231-
local -r STATUS_PATH="/var/lib/healthcheck/status"
232233
local -r mysqld="/usr/sbin/mysqld"
233234
local -r pattern_seconds_in_minute='^([1-9]|[1-5][0-9]|60)$'
234235
local -r redacted_value="********"
236+
local -r status_path="/var/lib/healthcheck/status"
235237
local -r system_timezone="$(
236238
__get_system_timezone
237239
)"
238240
local -r zone="$(
239241
system-timezone -qq
240242
)"
241243

242-
local QUIET="false"
244+
local quiet="false"
243245
local -i interval=10
244246

245247
# Trap and record the exit status
@@ -262,7 +264,7 @@ function main ()
262264
shift 1
263265
;;
264266
-q|--quiet)
265-
QUIET="true"
267+
quiet="true"
266268
shift 1
267269
;;
268270
*)
@@ -296,10 +298,9 @@ function main ()
296298
exit 1
297299
fi
298300

299-
# mysqld-bootstrap
300301
if [[ ${ENABLE_MYSQLD_BOOTSTRAP} == true ]]
301302
then
302-
if [[ -e /var/lock/subsys/mysqld-bootstrap ]] \
303+
if [[ -f /var/lock/subsys/mysqld-bootstrap ]] \
303304
|| ! __is_mysql_data_directory_populated
304305
then
305306
__print_message \
@@ -309,7 +310,6 @@ function main ()
309310
fi
310311
fi
311312

312-
# mysqld-wrapper
313313
if [[ ${ENABLE_MYSQLD_WRAPPER} == true ]]
314314
then
315315
if ! ps axo command \
@@ -338,6 +338,7 @@ function main ()
338338
if ! __have_mysql_access
339339
then
340340
__print_message \
341+
"error" \
341342
"root@localhost access failed."
342343
exit 1
343344
fi

0 commit comments

Comments
 (0)