Skip to content
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
5 changes: 3 additions & 2 deletions Dockerfile → 5.7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM ubuntu:xenial

MAINTAINER James Bacon [email protected]

USER root

## Create mysql user early to keep UID/GUID consistent
Expand Down Expand Up @@ -31,6 +29,9 @@ RUN /opt/docker-arm-mysql/initialise-mysql-insecure.bash
## Setup MySQL data directory as a volume
VOLUME /var/lib/mysql

## Create the init folder for sql files to import at first start up
RUN mkdir /docker-entrypoint-initdb.d

## Upload docker entrypoint script
COPY docker-entrypoint.sh /opt/docker-arm-mysql/

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 4 additions & 1 deletion install-mysql.bash → 5.7/install-mysql.bash
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ debconf-set-selections <<< "mysql-server mysql-server/root_password_again passwo
## Update the apt lists
apt-get update

## Install script dependencies
apt-get install -y --no-install-recommends bzip2 ca-certificates gosu openssl perl pwgen wget xz-utils zstd

## Install MySQL
apt-get install -y mysql-server-${MYSQL_MAJOR} tzdata
apt-get install -y "mysql-server-${MYSQL_MAJOR}" tzdata

## Clean up any mess
apt-get clean autoclean
Expand Down
45 changes: 45 additions & 0 deletions 8.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM ubuntu:jammy

USER root

## Create mysql user early to keep UID/GUID consistent
RUN groupadd -r mysql && useradd -r -g mysql mysql

## Set the mysql version to install
ENV MYSQL_MAJOR 8.0

## Upload MySQL install script
COPY install-mysql.bash /opt/docker-arm-mysql/

## Install MySQL
RUN /opt/docker-arm-mysql/install-mysql.bash

## Upload MySQL configuration for docker script
COPY configure-mysql-for-docker.bash /opt/docker-arm-mysql/

## Run MySQL configuration for docker script
RUN /opt/docker-arm-mysql/configure-mysql-for-docker.bash

## Upload script to initialise MySQL
COPY initialise-mysql-insecure.bash /opt/docker-arm-mysql/

## Run script to initialize MySQL
RUN /opt/docker-arm-mysql/initialise-mysql-insecure.bash

## Setup MySQL data directory as a volume
VOLUME /var/lib/mysql

## Create the init folder for sql files to import at first start up
RUN mkdir /docker-entrypoint-initdb.d

## Upload docker entrypoint script
COPY docker-entrypoint.sh /opt/docker-arm-mysql/

## Set the entrypoint script, used to configure depending on requirements.
ENTRYPOINT ["/opt/docker-arm-mysql/docker-entrypoint.sh"]

## Expose the MySQL ports
EXPOSE 3306 33060

## Set the default command to be the MySQL daemon
CMD ["mysqld"]
17 changes: 17 additions & 0 deletions 8.0/configure-mysql-for-docker.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

## Enable external connections
sed -i 's/^bind-address.*/bind-address = 0.0.0.0/g' /etc/mysql/mysql.conf.d/mysqld.cnf

## Disable use of the internal host cache for faster name-to-IP resolution.
{
echo ''
echo '[mysqld]'
echo 'skip-host-cache'
echo 'skip-name-resolve'
echo ''
} >> /etc/mysql/mysql.conf.d/docker.cnf

mkdir -p /var/lib/mysql /var/run/mysqld
chown -R mysql:mysql /var/lib/mysql /var/run/mysqld
chmod 1777 /var/run/mysqld /var/lib/mysql
Loading