2017-10-24 14:22:10 +02:00
|
|
|
FROM vmware/photon:1.0
|
2017-10-19 17:21:41 +02:00
|
|
|
|
|
|
|
#The Docker Daemon has to be running with storage backend btrfs when building the image
|
|
|
|
|
2017-12-20 06:10:32 +01:00
|
|
|
RUN tdnf distro-sync -y \
|
2017-10-19 17:21:41 +02:00
|
|
|
&& tdnf install -y sed shadow procps-ng gawk gzip sudo net-tools \
|
2017-11-02 04:51:32 +01:00
|
|
|
&& groupadd -r -g 10000 mysql && useradd --no-log-init -r -g 10000 -u 10000 mysql \
|
2017-10-19 17:21:41 +02:00
|
|
|
&& tdnf install -y mariadb-server mariadb \
|
2017-10-24 14:22:10 +02:00
|
|
|
&& mkdir /docker-entrypoint-initdb.d /docker-entrypoint-updatedb.d \
|
2017-10-19 17:21:41 +02:00
|
|
|
&& rm -fr /var/lib/mysql \
|
|
|
|
&& mkdir -p /var/lib/mysql /var/run/mysqld \
|
|
|
|
&& chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \
|
2017-10-24 14:22:10 +02:00
|
|
|
&& chmod 777 /var/run/mysqld /docker-entrypoint-initdb.d /docker-entrypoint-updatedb.d \
|
2017-10-19 17:21:41 +02:00
|
|
|
&& tdnf clean all
|
|
|
|
|
|
|
|
COPY docker-entrypoint.sh /usr/local/bin/
|
|
|
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
|
|
|
COPY my.cnf /etc/
|
|
|
|
RUN ln -s usr/local/bin/docker-entrypoint.sh /
|
|
|
|
|
2017-11-02 04:51:32 +01:00
|
|
|
VOLUME /var/lib/mysql /docker-entrypoint-initdb.d /docker-entrypoint-updatedb.d /tmp /var/run/mysqld
|
2017-10-19 17:21:41 +02:00
|
|
|
EXPOSE 3306
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
2017-12-09 19:53:12 +01:00
|
|
|
CMD ["mysqld"]
|