update mariadb. no need for supervisord

This commit is contained in:
dave 2017-07-14 18:56:58 -07:00
parent b7d3b74119
commit 56790f5a79
4 changed files with 22 additions and 19 deletions

View File

@ -1,23 +1,26 @@
FROM ubuntu:trusty
MAINTAINER Dave P
FROM ubuntu:xenial
# RUN sed -i -E 's/deb http:\/\/archive.ubuntu.com/deb http:\/\/debmirror.services.davepedu.com:8080/' /etc/apt/sources.list
# Create rduser (password is rduser)
RUN locale-gen en && \
RUN apt-get update && \
apt-get install -y software-properties-common && \
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 && \
add-apt-repository 'deb [arch=amd64] http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.2/ubuntu xenial main' && \
apt-get update && \
apt-get -y install supervisor && \
mkdir /var/run/mysqld && \
echo "mariadb-server-5.5 mysql-server/root_password_again password root" | debconf-set-selections && \
echo "mariadb-server-5.5 mysql-server/root_password password root" | debconf-set-selections && \
apt-get -y install mariadb-server-5.5 mariadb-client-5.5 && \
chown mysql:mysql /var/run/mysqld && \
echo "mariadb-server-10.2 mysql-server/root_password_again password root" | debconf-set-selections && \
echo "mariadb-server-10.2 mysql-server/root_password password root" | debconf-set-selections && \
apt-get install -y mariadb-server-10.2 mariadb-client-10.2 && \
sed -i -E 's/bind-address\s+=.+$/bind-address = 0.0.0.0/' /etc/mysql/my.cnf && \
rm -rf /var/lib/apt/lists/*
COPY supervisord-mariadb.conf /etc/supervisor/conf.d/mariadb.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD start /start
EXPOSE 3306
ENTRYPOINT ["/start"]
VOLUME /var/lib/mysql
USER mysql

12
start
View File

@ -1,7 +1,5 @@
#!/bin/bash
trap 'kill $(jobs -p)' EXIT
: ${MYSQL_PORT:=3306}
export MYSQL_PORT
@ -9,4 +7,12 @@ if [ ! -d /var/lib/mysql/mysql ] ; then
/usr/bin/mysql_install_db
fi
supervisord
exec /usr/sbin/mysqld \
--basedir=/usr \
--datadir=/var/lib/mysql
--plugin-dir=/usr/lib/mysql/plugin \
--user=mysql \
--log-error=/var/log/mysql/error.log \
--pid-file=/var/run/mysqld/mysqld.pid \
--socket=/var/run/mysqld/mysqld.sock \
--port=$MYSQL_PORT

View File

@ -1,3 +0,0 @@
[program:mysql]
command=/usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/log/mysql/error.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=%(ENV_MYSQL_PORT)s
autorestart=true

View File

@ -1,3 +0,0 @@
[supervisord]
nodaemon=true