-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hotfix-0.2.2' into stable
- Loading branch information
Showing
95 changed files
with
177 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
NAME = osixia/mariadb | ||
VERSION = 0.2.1 | ||
VERSION = 0.2.2 | ||
|
||
.PHONY: all build test tag_latest release | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,9 @@ | ||
FROM osixia/baseimage:0.10.1 | ||
FROM osixia/baseimage:0.10.2 | ||
MAINTAINER Bertrand Gouny <[email protected]> | ||
|
||
## Default configuration: can be overridden at the docker command line | ||
# Required for uninitialized and initialized database | ||
ENV ROOT_USER admin | ||
ENV ROOT_PWD admin | ||
|
||
# Required for uninitialized database | ||
ENV ROOT_ALLOWED_NETWORKS localhost,127.0.0.1,::1 | ||
|
||
# MariaDB version | ||
ENV MARIADB_MAJOR 10.0 | ||
ENV MARIADB_VERSION 10.0.15+maria-1~trusty | ||
ENV MARIADB_VERSION 10.0.16+maria-1~trusty | ||
|
||
# Set correct environment variables. | ||
ENV HOME /root | ||
|
@@ -24,25 +16,32 @@ CMD ["/sbin/my_init"] | |
RUN groupadd -r mysql && useradd -r -g mysql mysql | ||
|
||
# Add MariaDB repository | ||
RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db | ||
RUN echo "deb http://ftp.igh.cnrs.fr/pub/mariadb/repo/$MARIADB_MAJOR/ubuntu trusty main" > /etc/apt/sources.list.d/mariadb.list | ||
RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db \ | ||
&& echo "deb http://ftp.igh.cnrs.fr/pub/mariadb/repo/$MARIADB_MAJOR/ubuntu trusty main" > /etc/apt/sources.list.d/mariadb.list | ||
|
||
# Install MariaDB and remove default db | ||
# Install MariaDB , remove default db, | ||
RUN apt-get -y update \ | ||
&& LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
mariadb-server=$MARIADB_VERSION \ | ||
&& rm -rf /var/lib/mysql \ | ||
&& mkdir /var/lib/mysql | ||
&& mkdir /var/lib/mysql | ||
|
||
# Expose MariaDB default port | ||
EXPOSE 3306 | ||
# Add install script | ||
ADD service/install.sh /tmp/install.sh | ||
|
||
# Save this directory outside the container | ||
VOLUME ["/var/lib/mysql"] | ||
# Run install script and clean all | ||
RUN ./tmp/install.sh && rm /tmp/install.sh \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
# Add default env variables | ||
ADD env.yml /etc/env.yml | ||
|
||
# Add MariaDB container start config & daemon | ||
ADD service/mariadb/container-start.sh /etc/my_init.d/mariadb | ||
ADD service/mariadb/daemon.sh /etc/service/mariadb/run | ||
|
||
# Clear out the local repository of retrieved package files | ||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
# Set MariaDB database directory in a data volume | ||
VOLUME ["/var/lib/mysql"] | ||
|
||
# Expose MariaDB default port | ||
EXPOSE 3306 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ROOT_USER: admin | ||
ROOT_PWD: admin | ||
|
||
ROOT_ALLOWED_NETWORKS: | ||
- localhost | ||
- 127.0.0.1 | ||
- ::1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash -e | ||
# this script is run during the image build | ||
|
||
# MariaDB config | ||
|
||
# Allow remote connection | ||
sed -ri 's/^(bind-address|skip-networking)/;\1/' /etc/mysql/my.cnf | ||
|
||
# Disable local files loading | ||
sed -i '/\[mysqld\]/a\local-infile=0' /etc/mysql/my.cnf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,87 @@ | ||
#!/bin/bash | ||
#!/bin/bash -e | ||
|
||
# fix permissions and ownership of /var/lib/mysql | ||
chown -R mysql:mysql /var/lib/mysql | ||
chmod 700 /var/lib/mysql | ||
FIRST_START_DONE="/etc/docker-mariadb-first-start-done" | ||
|
||
# config sql queries | ||
TEMP_FILE='/tmp/mysql-start.sql' | ||
# container first start | ||
if [ ! -e "$FIRST_START_DONE" ]; then | ||
|
||
# The password for 'debian-sys-maint'@'localhost' is auto generated. | ||
# The database inside of DATA_DIR may not have been generated with this password. | ||
# So, we need to set this for our database to be portable. | ||
# https://github.com/Painted-Fox/docker-mariadb/blob/master/scripts/first_run.sh | ||
DB_MAINT_PASS=$(cat /etc/mysql/debian.cnf | grep -m 1 "password\s*=\s*"| sed 's/^password\s*=\s*//') | ||
# fix permissions and ownership of /var/lib/mysql | ||
chown -R mysql:mysql /var/lib/mysql | ||
chmod 700 /var/lib/mysql | ||
|
||
# database is uninitialized | ||
if [ -z "$(ls -A /var/lib/mysql)" ]; then | ||
# config sql queries | ||
TEMP_FILE='/tmp/mysql-start.sql' | ||
|
||
# Initializes the MySQL data directory and creates the system tables that it contains | ||
mysql_install_db --datadir=/var/lib/mysql | ||
# The password for 'debian-sys-maint'@'localhost' is auto generated. | ||
# The database inside of DATA_DIR may not have been generated with this password. | ||
# So, we need to set this for our database to be portable. | ||
# https://github.com/Painted-Fox/docker-mariadb/blob/master/scripts/first_run.sh | ||
DB_MAINT_PASS=$(cat /etc/mysql/debian.cnf | grep -m 1 "password\s*=\s*"| sed 's/^password\s*=\s*//') | ||
|
||
# allow remote connection | ||
sed -ri 's/^(bind-address|skip-networking)/;\1/' /etc/mysql/my.cnf | ||
# database is uninitialized | ||
if [ -z "$(ls -A /var/lib/mysql)" ]; then | ||
|
||
# Disable local files loading | ||
sed -i '/\[mysqld\]/a\local-infile=0' /etc/mysql/my.cnf | ||
# initializes the MySQL data directory and creates the system tables that it contains | ||
mysql_install_db --datadir=/var/lib/mysql | ||
|
||
# Start MariaDB | ||
service mysql start || true | ||
# start MariaDB | ||
service mysql start || true | ||
|
||
# drop all user and test database | ||
cat > "$TEMP_FILE" <<-EOSQL | ||
DELETE FROM mysql.user ; | ||
DROP DATABASE IF EXISTS test ; | ||
# drop all user and test database | ||
cat > "$TEMP_FILE" <<-EOSQL | ||
DELETE FROM mysql.user ; | ||
DROP DATABASE IF EXISTS test ; | ||
EOSQL | ||
|
||
# add root user on specified networks | ||
IFS=', ' read -a networks <<< "$ROOT_ALLOWED_NETWORKS" | ||
for network in "${networks[@]}" | ||
do | ||
echo "CREATE USER '$ROOT_USER'@'$network' IDENTIFIED BY '$ROOT_PWD' ;" >> "$TEMP_FILE" | ||
echo "GRANT ALL ON *.* TO '$ROOT_USER'@'$network' WITH GRANT OPTION ;" >> "$TEMP_FILE" | ||
done | ||
|
||
echo "CREATE USER 'debian-sys-maint'@'localhost' IDENTIFIED BY '$DB_MAINT_PASS' ;" >> "$TEMP_FILE" | ||
echo "GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '$DB_MAINT_PASS' ;" >> "$TEMP_FILE" | ||
|
||
# Flush privileges | ||
echo 'FLUSH PRIVILEGES ;' >> "$TEMP_FILE" | ||
|
||
# execute config queries | ||
mysql -u root < $TEMP_FILE | ||
|
||
# prevent socket error on stop | ||
sleep 1 | ||
|
||
# Stop MariaDB | ||
service mysql stop | ||
|
||
# database is initialized | ||
else | ||
|
||
# Start MariaDB | ||
service mysql start || true | ||
|
||
# drop all user and test database | ||
cat > "$TEMP_FILE" <<-EOSQL | ||
DELETE FROM mysql.user where user = 'debian-sys-maint' ; | ||
FLUSH PRIVILEGES ; | ||
CREATE USER 'debian-sys-maint'@'localhost' IDENTIFIED BY '$DB_MAINT_PASS' ; | ||
GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '$DB_MAINT_PASS' ; | ||
FLUSH PRIVILEGES ; | ||
# add root user on specified networks | ||
ROOT_ALLOWED_NETWORKS=($ROOT_ALLOWED_NETWORKS) | ||
for network in "${ROOT_ALLOWED_NETWORKS[@]}" | ||
do | ||
echo "GRANT ALL PRIVILEGES ON *.* TO '$ROOT_USER'@'${!network}' IDENTIFIED BY '$ROOT_PWD' WITH GRANT OPTION ;" >> "$TEMP_FILE" | ||
done | ||
|
||
echo "GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '$DB_MAINT_PASS' ;" >> "$TEMP_FILE" | ||
|
||
# flush privileges | ||
echo 'FLUSH PRIVILEGES ;' >> "$TEMP_FILE" | ||
|
||
# execute config queries | ||
mysql -u root < $TEMP_FILE | ||
|
||
# prevent socket error on stop | ||
sleep 1 | ||
|
||
# Stop MariaDB | ||
service mysql stop | ||
|
||
# database is initialized | ||
else | ||
|
||
# start MariaDB | ||
service mysql start || true | ||
|
||
# drop all user and test database | ||
cat > "$TEMP_FILE" <<-EOSQL | ||
DELETE FROM mysql.user where user = 'debian-sys-maint' ; | ||
FLUSH PRIVILEGES ; | ||
GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '$DB_MAINT_PASS' ; | ||
FLUSH PRIVILEGES ; | ||
EOSQL | ||
|
||
# execute config queries | ||
mysql -u $ROOT_USER -p$ROOT_PWD < $TEMP_FILE | ||
# execute config queries | ||
mysql -u $ROOT_USER -p$ROOT_PWD < $TEMP_FILE | ||
|
||
# prevent socket error on stop | ||
sleep 1 | ||
# prevent socket error on stop | ||
sleep 1 | ||
|
||
# Stop MariaDB | ||
service mysql stop | ||
# stop MariaDB | ||
service mysql stop | ||
|
||
fi | ||
fi | ||
|
||
rm $TEMP_FILE | ||
rm $TEMP_FILE | ||
|
||
touch $FIRST_START_DONE | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
#!/bin/bash | ||
|
||
# Exit immediately if a command exits with a non-zero status. | ||
set -e | ||
|
||
exec /usr/bin/mysqld_safe | ||
#!/bin/bash -e | ||
exec /usr/bin/mysqld_safe |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
10.0.15-MariaDB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-1.27 KB
test/database/performance_schema/events_stages_summary_by_account_by_event_name.frm
Binary file not shown.
Binary file removed
BIN
-1.2 KB
test/database/performance_schema/events_stages_summary_by_host_by_event_name.frm
Binary file not shown.
Binary file removed
BIN
-1.04 KB
test/database/performance_schema/events_stages_summary_by_thread_by_event_name.frm
Binary file not shown.
Binary file removed
BIN
-1.08 KB
test/database/performance_schema/events_stages_summary_by_user_by_event_name.frm
Binary file not shown.
Binary file removed
BIN
-1.01 KB
test/database/performance_schema/events_stages_summary_global_by_event_name.frm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-3.67 KB
test/database/performance_schema/events_statements_history_long.frm
Binary file not shown.
Binary file removed
BIN
-2.08 KB
test/database/performance_schema/events_statements_summary_by_account_by_event_name.frm
Binary file not shown.
Binary file removed
BIN
-1.84 KB
test/database/performance_schema/events_statements_summary_by_digest.frm
Binary file not shown.
Binary file removed
BIN
-2.01 KB
test/database/performance_schema/events_statements_summary_by_host_by_event_name.frm
Binary file not shown.
Binary file removed
BIN
-1.84 KB
test/database/performance_schema/events_statements_summary_by_thread_by_event_name.frm
Binary file not shown.
Binary file removed
BIN
-1.88 KB
test/database/performance_schema/events_statements_summary_by_user_by_event_name.frm
Binary file not shown.
Binary file removed
BIN
-1.81 KB
test/database/performance_schema/events_statements_summary_global_by_event_name.frm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
test/database/performance_schema/events_waits_history_long.frm
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
test/database/performance_schema/events_waits_summary_by_account_by_event_name.frm
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
test/database/performance_schema/events_waits_summary_by_host_by_event_name.frm
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
test/database/performance_schema/events_waits_summary_by_instance.frm
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
test/database/performance_schema/events_waits_summary_by_thread_by_event_name.frm
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
test/database/performance_schema/events_waits_summary_by_user_by_event_name.frm
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
test/database/performance_schema/events_waits_summary_global_by_event_name.frm
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
test/database/performance_schema/file_summary_by_event_name.frm
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
test/database/performance_schema/file_summary_by_instance.frm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
test/database/performance_schema/objects_summary_global_by_type.frm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
test/database/performance_schema/socket_summary_by_event_name.frm
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
test/database/performance_schema/socket_summary_by_instance.frm
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
test/database/performance_schema/table_io_waits_summary_by_index_usage.frm
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
test/database/performance_schema/table_io_waits_summary_by_table.frm
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
test/database/performance_schema/table_lock_waits_summary_by_table.frm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.