Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

Change mariadb and mysql from supervisord to single process #200

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 0 additions & 146 deletions mariadb/supervisord.conf

This file was deleted.

10 changes: 3 additions & 7 deletions mysql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ MAINTAINER http://fedoraproject.org/wiki/Cloud
RUN dnf -y update && dnf clean all
RUN dnf -y install community-mysql-server community-mysql pwgen supervisor bash-completion psmisc net-tools && dnf clean all

ADD ./start.sh /start.sh
ADD ./config_mysql.sh /config_mysql.sh
ADD ./supervisord.conf /etc/supervisord.conf
ADD scripts /scripts

# RUN echo %sudo ALL=NOPASSWD: ALL >> /etc/sudoers

RUN chmod 755 /start.sh
RUN chmod 755 /config_mysql.sh
RUN /config_mysql.sh
RUN chmod 755 /scripts/*

EXPOSE 3306

CMD ["/bin/bash", "/start.sh"]
CMD ["/bin/bash", "/scripts/start.sh"]
29 changes: 0 additions & 29 deletions mysql/config_mysql.sh

This file was deleted.

25 changes: 25 additions & 0 deletions mysql/scripts/config_mysql.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

__mysql_config() {
echo "Running the mysql_config function."
mysql_install_db
chown -R mysql:mysql /var/lib/mysql
/usr/bin/mysqld_safe &
sleep 10
}

__start_mysql() {
echo "Running the start_mysql function."
mysqladmin -u root password mysqlPassword
mysql -uroot -pmysqlPassword -e "CREATE DATABASE testdb"
mysql -uroot -pmysqlPassword -e "GRANT ALL PRIVILEGES ON testdb.* TO 'testdb'@'localhost' IDENTIFIED BY 'mysqlPassword'; FLUSH PRIVILEGES;"
mysql -uroot -pmysqlPassword -e "GRANT ALL PRIVILEGES ON *.* TO 'testdb'@'%' IDENTIFIED BY 'mysqlPassword' WITH GRANT OPTION; FLUSH PRIVILEGES;"
mysql -uroot -pmysqlPassword -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mysqlPassword' WITH GRANT OPTION; FLUSH PRIVILEGES;"
mysql -uroot -pmysqlPassword -e "select user, host FROM mysql.user;"
killall mysqld
sleep 10
}

# Call all functions
__mysql_config
__start_mysql
8 changes: 8 additions & 0 deletions mysql/scripts/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

if [ -x /scripts/config_mysql.sh ]; then
/scripts/config_mysql.sh
fi

rm -f /run/mysqld/mysqld.sock
exec /usr/bin/mysqld_safe
9 changes: 0 additions & 9 deletions mysql/start.sh

This file was deleted.

Loading