├── .gitignore ├── CONTRIBUTING.md ├── README.md ├── SECURITY.md ├── mysql-cluster ├── 7.5 │ ├── Dockerfile │ ├── cnf │ │ ├── my.cnf │ │ └── mysql-cluster.cnf │ ├── docker-entrypoint.sh │ ├── healthcheck.sh │ ├── inspec │ │ └── control.rb │ └── prepare-image.sh ├── 7.6 │ ├── Dockerfile │ ├── cnf │ │ ├── my.cnf │ │ └── mysql-cluster.cnf │ ├── docker-entrypoint.sh │ ├── healthcheck.sh │ ├── inspec │ │ └── control.rb │ └── prepare-image.sh ├── 8.0 │ ├── Dockerfile │ ├── cnf │ │ ├── my.cnf │ │ └── mysql-cluster.cnf │ ├── docker-entrypoint.sh │ ├── healthcheck.sh │ ├── inspec │ │ └── control.rb │ └── prepare-image.sh ├── 8.1 │ ├── Dockerfile │ ├── cnf │ │ ├── my.cnf │ │ └── mysql-cluster.cnf │ ├── docker-entrypoint.sh │ ├── healthcheck.sh │ ├── inspec │ │ └── control.rb │ └── prepare-image.sh ├── 8.2 │ ├── Dockerfile │ ├── cnf │ │ ├── my.cnf │ │ └── mysql-cluster.cnf │ ├── docker-entrypoint.sh │ ├── healthcheck.sh │ ├── inspec │ │ └── control.rb │ └── prepare-image.sh ├── 8.3 │ ├── Dockerfile │ ├── cnf │ │ ├── my.cnf │ │ └── mysql-cluster.cnf │ ├── docker-entrypoint.sh │ ├── healthcheck.sh │ ├── inspec │ │ └── control.rb │ └── prepare-image.sh ├── 8.4 │ ├── Dockerfile │ ├── cnf │ │ ├── my.cnf │ │ └── mysql-cluster.cnf │ ├── docker-entrypoint.sh │ ├── healthcheck.sh │ ├── inspec │ │ └── control.rb │ └── prepare-image.sh ├── 9.0 │ ├── Dockerfile │ ├── cnf │ │ ├── my.cnf │ │ └── mysql-cluster.cnf │ ├── docker-entrypoint.sh │ ├── healthcheck.sh │ ├── inspec │ │ └── control.rb │ └── prepare-image.sh ├── 9.1 │ ├── Dockerfile │ ├── cnf │ │ ├── my.cnf │ │ └── mysql-cluster.cnf │ ├── docker-entrypoint.sh │ ├── healthcheck.sh │ ├── inspec │ │ └── control.rb │ └── prepare-image.sh ├── 9.2 │ ├── Dockerfile │ ├── cnf │ │ ├── my.cnf │ │ └── mysql-cluster.cnf │ ├── docker-entrypoint.sh │ ├── healthcheck.sh │ ├── inspec │ │ └── control.rb │ └── prepare-image.sh ├── 9.3 │ ├── Dockerfile │ ├── cnf │ │ ├── my.cnf │ │ └── mysql-cluster.cnf │ ├── docker-entrypoint.sh │ ├── healthcheck.sh │ ├── inspec │ │ └── control.rb │ └── prepare-image.sh ├── README.md ├── VERSION ├── build.sh ├── changelog ├── gen_dockerfiles.sh ├── tag.sh ├── template │ ├── Dockerfile │ ├── Dockerfile-pre8 │ ├── cnf │ │ ├── my.cnf │ │ └── mysql-cluster.cnf │ ├── control.rb │ ├── docker-entrypoint.sh │ ├── healthcheck.sh │ └── prepare-image.sh └── test.sh ├── mysql-router ├── 8.0 │ ├── Dockerfile │ ├── README.md │ ├── inspec │ │ └── control.rb │ └── run.sh ├── 8.1 │ ├── Dockerfile │ ├── README.md │ ├── inspec │ │ └── control.rb │ └── run.sh ├── 8.2 │ ├── Dockerfile │ ├── README.md │ ├── inspec │ │ └── control.rb │ └── run.sh ├── 8.3 │ ├── Dockerfile │ ├── README.md │ ├── inspec │ │ └── control.rb │ └── run.sh ├── 8.4 │ ├── Dockerfile │ ├── README.md │ ├── inspec │ │ └── control.rb │ └── run.sh ├── 9.0 │ ├── Dockerfile │ ├── README.md │ ├── inspec │ │ └── control.rb │ └── run.sh ├── 9.1 │ ├── Dockerfile │ ├── README.md │ ├── inspec │ │ └── control.rb │ └── run.sh ├── 9.2 │ ├── Dockerfile │ ├── README.md │ ├── inspec │ │ └── control.rb │ └── run.sh ├── 9.3 │ ├── Dockerfile │ ├── README.md │ ├── inspec │ │ └── control.rb │ └── run.sh ├── README.md ├── VERSION ├── build.sh ├── gen_dockerfiles.sh ├── manifest.sh ├── tag.sh ├── template │ ├── Dockerfile │ ├── control.rb │ └── run.sh └── test.sh └── mysql-server ├── 8.0 ├── Dockerfile ├── docker-entrypoint.sh ├── healthcheck.sh ├── inspec │ └── control.rb └── prepare-image.sh ├── 8.1 ├── Dockerfile ├── docker-entrypoint.sh ├── healthcheck.sh ├── inspec │ └── control.rb └── prepare-image.sh ├── 8.2 ├── Dockerfile ├── docker-entrypoint.sh ├── healthcheck.sh ├── inspec │ └── control.rb └── prepare-image.sh ├── 8.3 ├── Dockerfile ├── docker-entrypoint.sh ├── healthcheck.sh ├── inspec │ └── control.rb └── prepare-image.sh ├── 8.4 ├── Dockerfile ├── docker-entrypoint.sh ├── healthcheck.sh ├── inspec │ └── control.rb └── prepare-image.sh ├── 9.0 ├── Dockerfile ├── docker-entrypoint.sh ├── healthcheck.sh ├── inspec │ └── control.rb └── prepare-image.sh ├── 9.1 ├── Dockerfile ├── docker-entrypoint.sh ├── healthcheck.sh ├── inspec │ └── control.rb └── prepare-image.sh ├── 9.2 ├── Dockerfile ├── docker-entrypoint.sh ├── healthcheck.sh ├── inspec │ └── control.rb └── prepare-image.sh ├── 9.3 ├── Dockerfile ├── docker-entrypoint.sh ├── healthcheck.sh ├── inspec │ └── control.rb └── prepare-image.sh ├── README.md ├── VERSION ├── build.sh ├── changelog ├── gen_dockerfiles.sh ├── manifest.sh ├── mysql-community-minimal-release ├── Dockerfile ├── docker-entrypoint.sh ├── healthcheck.sh ├── inspec │ └── control.rb └── prepare-image.sh ├── tag.sh ├── template ├── Dockerfile ├── control.rb ├── docker-entrypoint.sh ├── healthcheck.sh └── prepare-image.sh └── test.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | We welcome your code contributions. Before submitting code via a GitHub pull 2 | request, or by filing a bug in https://bugs.mysql.com you will need to have 3 | signed the Oracle Contributor Agreement (see https://oca.opensource.oracle.com). 4 | 5 | Only pull requests from committers that can be verified as having signed the OCA 6 | can be accepted. 7 | 8 | Submitting a contribution 9 | -------------------------- 10 | 11 | 1. Make sure you have a user account at bugs.mysql.com. You'll need to reference this 12 | user account when you submit your OCA (Oracle Contributor Agreement). 13 | 2. Sign the Oracle OCA. You can find instructions for doing that at the OCA Page, 14 | at https://oca.opensource.oracle.com 15 | 3. Validate your contribution by including tests that sufficiently cover the functionality. 16 | 4. Verify that the entire test suite passes with your code applied. 17 | 5. Submit your pull request via GitHub or uploading it using the contribution tab to a bug 18 | record in https://bugs.mysql.com (using the 'contribution' tab). 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # About This Repository 2 | 3 | This repository collects files and tools related to creating Container (Docker) images for different MySQL products. 4 | 5 | Please refer to the indvidual directories for information, including licenses, for the individual products. 6 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | Reporting security vulnerabilities 2 | ==================== 3 | Oracle values the independent security research community and believes that 4 | responsible disclosure of security vulnerabilities helps us ensure the security 5 | and privacy of all our users. 6 | 7 | Please do NOT raise a GitHub Issue to report a security vulnerability. If you 8 | believe you have found a security vulnerability, please submit a report to 9 | secalert_us@oracle.com preferably with a proof of concept. Please review 10 | some additional information on how to report security vulnerabilities to Oracle 11 | (see https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html) 12 | We encourage people who contact Oracle Security to use email encryption using 13 | our encryption key (see https://www.oracle.com/security-alerts/encryptionkey.html) 14 | 15 | We ask that you do not use other channels or contact the project maintainers 16 | directly. 17 | 18 | Security updates, alerts and bulletins 19 | ------------------------------------- 20 | Security updates will be released on a regular cadence. Many of our projects 21 | will typically release security fixes in conjunction with the Oracle Critical Patch 22 | Update program. Additional information, including past advisories, is available on our 23 | security alerts page at https://www.oracle.com/security-alerts/ 24 | 25 | Security-related information 26 | ---------------------------- 27 | We will provide security related information such as a threat model, considerations 28 | for secure use, or any known security issues in our documentation. Please note 29 | that labs and sample code are intended to demonstrate a concept and may not be 30 | sufficiently hardened for production use. 31 | -------------------------------------------------------------------------------- /mysql-cluster/7.5/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:7-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-7.5.32 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.35 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el7.rpm \ 23 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el7.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN yum install -y $MYSQL_SHELL_PACKAGE \ 27 | && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=mysql-cluster75-community-minimal\ 28 | && yum clean all \ 29 | && mkdir /docker-entrypoint-initdb.d 30 | 31 | COPY prepare-image.sh / 32 | RUN /prepare-image.sh && rm -f /prepare-image.sh 33 | 34 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 35 | 36 | COPY docker-entrypoint.sh /entrypoint.sh 37 | COPY healthcheck.sh /healthcheck.sh 38 | COPY cnf/my.cnf /etc/ 39 | COPY cnf/mysql-cluster.cnf /etc/ 40 | 41 | ENTRYPOINT ["/entrypoint.sh"] 42 | HEALTHCHECK CMD /healthcheck.sh 43 | EXPOSE 3306 33060 2202 1186 44 | CMD ["mysqld"] 45 | 46 | -------------------------------------------------------------------------------- /mysql-cluster/7.5/cnf/my.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [mysqld] 17 | ndbcluster 18 | ndb-connectstring=192.168.0.2 19 | user=mysql 20 | 21 | [mysql_cluster] 22 | ndb-connectstring=192.168.0.2 23 | -------------------------------------------------------------------------------- /mysql-cluster/7.5/cnf/mysql-cluster.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [ndbd default] 17 | NoOfReplicas=2 18 | DataMemory=80M 19 | IndexMemory=18M 20 | 21 | 22 | [ndb_mgmd] 23 | NodeId=1 24 | hostname=192.168.0.2 25 | datadir=/var/lib/mysql 26 | 27 | [ndbd] 28 | NodeId=2 29 | hostname=192.168.0.3 30 | datadir=/var/lib/mysql 31 | 32 | [ndbd] 33 | NodeId=3 34 | hostname=192.168.0.4 35 | datadir=/var/lib/mysql 36 | 37 | [mysqld] 38 | NodeId=4 39 | hostname=192.168.0.10 40 | -------------------------------------------------------------------------------- /mysql-cluster/7.5/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-cluster/7.5/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-cluster:7.5/ } 7 | its('names') { should include "mysql-cluster-7.5" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-cluster-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '7.5.32.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '8.0.35.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-cluster/7.5/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-cluster/7.6/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:7-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-7.6.28 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.35 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el7.rpm \ 23 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el7.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN yum install -y $MYSQL_SHELL_PACKAGE \ 27 | && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=mysql-cluster76-community-minimal\ 28 | && yum clean all \ 29 | && mkdir /docker-entrypoint-initdb.d 30 | 31 | COPY prepare-image.sh / 32 | RUN /prepare-image.sh && rm -f /prepare-image.sh 33 | 34 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 35 | 36 | COPY docker-entrypoint.sh /entrypoint.sh 37 | COPY healthcheck.sh /healthcheck.sh 38 | COPY cnf/my.cnf /etc/ 39 | COPY cnf/mysql-cluster.cnf /etc/ 40 | 41 | ENTRYPOINT ["/entrypoint.sh"] 42 | HEALTHCHECK CMD /healthcheck.sh 43 | EXPOSE 3306 33060 2202 1186 44 | CMD ["mysqld"] 45 | 46 | -------------------------------------------------------------------------------- /mysql-cluster/7.6/cnf/my.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [mysqld] 17 | ndbcluster 18 | ndb-connectstring=192.168.0.2 19 | user=mysql 20 | 21 | [mysql_cluster] 22 | ndb-connectstring=192.168.0.2 23 | -------------------------------------------------------------------------------- /mysql-cluster/7.6/cnf/mysql-cluster.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [ndbd default] 17 | NoOfReplicas=2 18 | DataMemory=80M 19 | IndexMemory=18M 20 | 21 | 22 | [ndb_mgmd] 23 | NodeId=1 24 | hostname=192.168.0.2 25 | datadir=/var/lib/mysql 26 | 27 | [ndbd] 28 | NodeId=2 29 | hostname=192.168.0.3 30 | datadir=/var/lib/mysql 31 | 32 | [ndbd] 33 | NodeId=3 34 | hostname=192.168.0.4 35 | datadir=/var/lib/mysql 36 | 37 | [mysqld] 38 | NodeId=4 39 | hostname=192.168.0.10 40 | -------------------------------------------------------------------------------- /mysql-cluster/7.6/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-cluster/7.6/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-cluster:7.6/ } 7 | its('names') { should include "mysql-cluster-7.6" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-cluster-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '7.6.28.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '8.0.35.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-cluster/7.6/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-cluster/8.0/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.0.42 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.42 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ 23 | && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol9_appstream \ 29 | --enablerepo=mysql-cluster80-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf clean all \ 31 | && mkdir /docker-entrypoint-initdb.d 32 | 33 | COPY prepare-image.sh / 34 | RUN /prepare-image.sh && rm -f /prepare-image.sh 35 | 36 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 37 | 38 | COPY docker-entrypoint.sh /entrypoint.sh 39 | COPY healthcheck.sh /healthcheck.sh 40 | COPY cnf/my.cnf /etc/ 41 | COPY cnf/mysql-cluster.cnf /etc/ 42 | 43 | ENTRYPOINT ["/entrypoint.sh"] 44 | HEALTHCHECK CMD /healthcheck.sh 45 | EXPOSE 3306 33060-33061 2202 1186 46 | CMD ["mysqld"] 47 | 48 | -------------------------------------------------------------------------------- /mysql-cluster/8.0/cnf/my.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [mysqld] 17 | ndbcluster 18 | ndb-connectstring=192.168.0.2 19 | user=mysql 20 | 21 | [mysql_cluster] 22 | ndb-connectstring=192.168.0.2 23 | -------------------------------------------------------------------------------- /mysql-cluster/8.0/cnf/mysql-cluster.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [ndbd default] 17 | NoOfReplicas=2 18 | DataMemory=80M 19 | IndexMemory=18M 20 | 21 | 22 | [ndb_mgmd] 23 | NodeId=1 24 | hostname=192.168.0.2 25 | datadir=/var/lib/mysql 26 | 27 | [ndbd] 28 | NodeId=2 29 | hostname=192.168.0.3 30 | datadir=/var/lib/mysql 31 | 32 | [ndbd] 33 | NodeId=3 34 | hostname=192.168.0.4 35 | datadir=/var/lib/mysql 36 | 37 | [mysqld] 38 | NodeId=4 39 | hostname=192.168.0.10 40 | -------------------------------------------------------------------------------- /mysql-cluster/8.0/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-cluster/8.0/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-cluster:8.0/ } 7 | its('names') { should include "mysql-cluster-8.0" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-cluster-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '8.0.42.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '8.0.42.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-cluster/8.0/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-cluster/8.1/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:8-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.1.0 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.1.0 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el8.rpm \ 23 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el8.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol8_appstream \ 29 | --enablerepo=mysql-cluster-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf clean all \ 31 | && mkdir /docker-entrypoint-initdb.d 32 | 33 | COPY prepare-image.sh / 34 | RUN /prepare-image.sh && rm -f /prepare-image.sh 35 | 36 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 37 | 38 | COPY docker-entrypoint.sh /entrypoint.sh 39 | COPY healthcheck.sh /healthcheck.sh 40 | COPY cnf/my.cnf /etc/ 41 | COPY cnf/mysql-cluster.cnf /etc/ 42 | 43 | ENTRYPOINT ["/entrypoint.sh"] 44 | HEALTHCHECK CMD /healthcheck.sh 45 | EXPOSE 3306 33060-33061 2202 1186 46 | CMD ["mysqld"] 47 | 48 | -------------------------------------------------------------------------------- /mysql-cluster/8.1/cnf/my.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [mysqld] 17 | ndbcluster 18 | ndb-connectstring=192.168.0.2 19 | user=mysql 20 | 21 | [mysql_cluster] 22 | ndb-connectstring=192.168.0.2 23 | -------------------------------------------------------------------------------- /mysql-cluster/8.1/cnf/mysql-cluster.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [ndbd default] 17 | NoOfReplicas=2 18 | DataMemory=80M 19 | IndexMemory=18M 20 | 21 | 22 | [ndb_mgmd] 23 | NodeId=1 24 | hostname=192.168.0.2 25 | datadir=/var/lib/mysql 26 | 27 | [ndbd] 28 | NodeId=2 29 | hostname=192.168.0.3 30 | datadir=/var/lib/mysql 31 | 32 | [ndbd] 33 | NodeId=3 34 | hostname=192.168.0.4 35 | datadir=/var/lib/mysql 36 | 37 | [mysqld] 38 | NodeId=4 39 | hostname=192.168.0.10 40 | -------------------------------------------------------------------------------- /mysql-cluster/8.1/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-cluster/8.1/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-cluster:8.1/ } 7 | its('names') { should include "mysql-cluster-8.1" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-cluster-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '8.1.0.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '8.1.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-cluster/8.1/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-cluster/8.2/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:8-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.2.0 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.2.0 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el8.rpm \ 23 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el8.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol8_appstream \ 29 | --enablerepo=mysql-cluster-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf clean all \ 31 | && mkdir /docker-entrypoint-initdb.d 32 | 33 | COPY prepare-image.sh / 34 | RUN /prepare-image.sh && rm -f /prepare-image.sh 35 | 36 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 37 | 38 | COPY docker-entrypoint.sh /entrypoint.sh 39 | COPY healthcheck.sh /healthcheck.sh 40 | COPY cnf/my.cnf /etc/ 41 | COPY cnf/mysql-cluster.cnf /etc/ 42 | 43 | ENTRYPOINT ["/entrypoint.sh"] 44 | HEALTHCHECK CMD /healthcheck.sh 45 | EXPOSE 3306 33060-33061 2202 1186 46 | CMD ["mysqld"] 47 | 48 | -------------------------------------------------------------------------------- /mysql-cluster/8.2/cnf/my.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [mysqld] 17 | ndbcluster 18 | ndb-connectstring=192.168.0.2 19 | user=mysql 20 | 21 | [mysql_cluster] 22 | ndb-connectstring=192.168.0.2 23 | -------------------------------------------------------------------------------- /mysql-cluster/8.2/cnf/mysql-cluster.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [ndbd default] 17 | NoOfReplicas=2 18 | DataMemory=80M 19 | IndexMemory=18M 20 | 21 | 22 | [ndb_mgmd] 23 | NodeId=1 24 | hostname=192.168.0.2 25 | datadir=/var/lib/mysql 26 | 27 | [ndbd] 28 | NodeId=2 29 | hostname=192.168.0.3 30 | datadir=/var/lib/mysql 31 | 32 | [ndbd] 33 | NodeId=3 34 | hostname=192.168.0.4 35 | datadir=/var/lib/mysql 36 | 37 | [mysqld] 38 | NodeId=4 39 | hostname=192.168.0.10 40 | -------------------------------------------------------------------------------- /mysql-cluster/8.2/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-cluster/8.2/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-cluster:8.2/ } 7 | its('names') { should include "mysql-cluster-8.2" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-cluster-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '8.2.0.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '8.2.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-cluster/8.2/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-cluster/8.3/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:8-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.3.0 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.3.0 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el8.rpm \ 23 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el8.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol8_appstream \ 29 | --enablerepo=mysql-cluster-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf clean all \ 31 | && mkdir /docker-entrypoint-initdb.d 32 | 33 | COPY prepare-image.sh / 34 | RUN /prepare-image.sh && rm -f /prepare-image.sh 35 | 36 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 37 | 38 | COPY docker-entrypoint.sh /entrypoint.sh 39 | COPY healthcheck.sh /healthcheck.sh 40 | COPY cnf/my.cnf /etc/ 41 | COPY cnf/mysql-cluster.cnf /etc/ 42 | 43 | ENTRYPOINT ["/entrypoint.sh"] 44 | HEALTHCHECK CMD /healthcheck.sh 45 | EXPOSE 3306 33060-33061 2202 1186 46 | CMD ["mysqld"] 47 | 48 | -------------------------------------------------------------------------------- /mysql-cluster/8.3/cnf/my.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [mysqld] 17 | ndbcluster 18 | ndb-connectstring=192.168.0.2 19 | user=mysql 20 | 21 | [mysql_cluster] 22 | ndb-connectstring=192.168.0.2 23 | -------------------------------------------------------------------------------- /mysql-cluster/8.3/cnf/mysql-cluster.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [ndbd default] 17 | NoOfReplicas=2 18 | DataMemory=80M 19 | IndexMemory=18M 20 | 21 | 22 | [ndb_mgmd] 23 | NodeId=1 24 | hostname=192.168.0.2 25 | datadir=/var/lib/mysql 26 | 27 | [ndbd] 28 | NodeId=2 29 | hostname=192.168.0.3 30 | datadir=/var/lib/mysql 31 | 32 | [ndbd] 33 | NodeId=3 34 | hostname=192.168.0.4 35 | datadir=/var/lib/mysql 36 | 37 | [mysqld] 38 | NodeId=4 39 | hostname=192.168.0.10 40 | -------------------------------------------------------------------------------- /mysql-cluster/8.3/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-cluster/8.3/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-cluster:8.3/ } 7 | its('names') { should include "mysql-cluster-8.3" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-cluster-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '8.3.0.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '8.3.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-cluster/8.3/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-cluster/8.4/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-8.4.5 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.5 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ 23 | && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-8.4-lts-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol9_appstream \ 29 | --enablerepo=mysql-cluster-8.4-lts-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf clean all \ 31 | && mkdir /docker-entrypoint-initdb.d 32 | 33 | COPY prepare-image.sh / 34 | RUN /prepare-image.sh && rm -f /prepare-image.sh 35 | 36 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 37 | 38 | COPY docker-entrypoint.sh /entrypoint.sh 39 | COPY healthcheck.sh /healthcheck.sh 40 | COPY cnf/my.cnf /etc/ 41 | COPY cnf/mysql-cluster.cnf /etc/ 42 | 43 | ENTRYPOINT ["/entrypoint.sh"] 44 | HEALTHCHECK CMD /healthcheck.sh 45 | EXPOSE 3306 33060-33061 2202 1186 46 | CMD ["mysqld"] 47 | 48 | -------------------------------------------------------------------------------- /mysql-cluster/8.4/cnf/my.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [mysqld] 17 | ndbcluster 18 | ndb-connectstring=192.168.0.2 19 | user=mysql 20 | 21 | [mysql_cluster] 22 | ndb-connectstring=192.168.0.2 23 | -------------------------------------------------------------------------------- /mysql-cluster/8.4/cnf/mysql-cluster.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [ndbd default] 17 | NoOfReplicas=2 18 | DataMemory=80M 19 | IndexMemory=18M 20 | 21 | 22 | [ndb_mgmd] 23 | NodeId=1 24 | hostname=192.168.0.2 25 | datadir=/var/lib/mysql 26 | 27 | [ndbd] 28 | NodeId=2 29 | hostname=192.168.0.3 30 | datadir=/var/lib/mysql 31 | 32 | [ndbd] 33 | NodeId=3 34 | hostname=192.168.0.4 35 | datadir=/var/lib/mysql 36 | 37 | [mysqld] 38 | NodeId=4 39 | hostname=192.168.0.10 40 | -------------------------------------------------------------------------------- /mysql-cluster/8.4/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-cluster/8.4/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-cluster:8.4/ } 7 | its('names') { should include "mysql-cluster-8.4" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-cluster-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '8.4.5.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '8.4.5.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-cluster/8.4/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-cluster/9.0/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-9.0.1 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.0.1 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el9.rpm \ 23 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol9_appstream \ 29 | --enablerepo=mysql-cluster-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf clean all \ 31 | && mkdir /docker-entrypoint-initdb.d 32 | 33 | COPY prepare-image.sh / 34 | RUN /prepare-image.sh && rm -f /prepare-image.sh 35 | 36 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 37 | 38 | COPY docker-entrypoint.sh /entrypoint.sh 39 | COPY healthcheck.sh /healthcheck.sh 40 | COPY cnf/my.cnf /etc/ 41 | COPY cnf/mysql-cluster.cnf /etc/ 42 | 43 | ENTRYPOINT ["/entrypoint.sh"] 44 | HEALTHCHECK CMD /healthcheck.sh 45 | EXPOSE 3306 33060-33061 2202 1186 46 | CMD ["mysqld"] 47 | 48 | -------------------------------------------------------------------------------- /mysql-cluster/9.0/cnf/my.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [mysqld] 17 | ndbcluster 18 | ndb-connectstring=192.168.0.2 19 | user=mysql 20 | 21 | [mysql_cluster] 22 | ndb-connectstring=192.168.0.2 23 | -------------------------------------------------------------------------------- /mysql-cluster/9.0/cnf/mysql-cluster.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [ndbd default] 17 | NoOfReplicas=2 18 | DataMemory=80M 19 | IndexMemory=18M 20 | 21 | 22 | [ndb_mgmd] 23 | NodeId=1 24 | hostname=192.168.0.2 25 | datadir=/var/lib/mysql 26 | 27 | [ndbd] 28 | NodeId=2 29 | hostname=192.168.0.3 30 | datadir=/var/lib/mysql 31 | 32 | [ndbd] 33 | NodeId=3 34 | hostname=192.168.0.4 35 | datadir=/var/lib/mysql 36 | 37 | [mysqld] 38 | NodeId=4 39 | hostname=192.168.0.10 40 | -------------------------------------------------------------------------------- /mysql-cluster/9.0/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-cluster/9.0/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-cluster:9.0/ } 7 | its('names') { should include "mysql-cluster-9.0" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-cluster-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '9.0.1.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '9.0.1.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-cluster/9.0/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-cluster/9.1/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-9.1.0 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.1.0 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-cluster-community-minimal-release-el9.rpm \ 23 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol9_appstream \ 29 | --enablerepo=mysql-cluster-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf clean all \ 31 | && mkdir /docker-entrypoint-initdb.d 32 | 33 | COPY prepare-image.sh / 34 | RUN /prepare-image.sh && rm -f /prepare-image.sh 35 | 36 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 37 | 38 | COPY docker-entrypoint.sh /entrypoint.sh 39 | COPY healthcheck.sh /healthcheck.sh 40 | COPY cnf/my.cnf /etc/ 41 | COPY cnf/mysql-cluster.cnf /etc/ 42 | 43 | ENTRYPOINT ["/entrypoint.sh"] 44 | HEALTHCHECK CMD /healthcheck.sh 45 | EXPOSE 3306 33060-33061 2202 1186 46 | CMD ["mysqld"] 47 | 48 | -------------------------------------------------------------------------------- /mysql-cluster/9.1/cnf/my.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [mysqld] 17 | ndbcluster 18 | ndb-connectstring=192.168.0.2 19 | user=mysql 20 | 21 | [mysql_cluster] 22 | ndb-connectstring=192.168.0.2 23 | -------------------------------------------------------------------------------- /mysql-cluster/9.1/cnf/mysql-cluster.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [ndbd default] 17 | NoOfReplicas=2 18 | DataMemory=80M 19 | IndexMemory=18M 20 | 21 | 22 | [ndb_mgmd] 23 | NodeId=1 24 | hostname=192.168.0.2 25 | datadir=/var/lib/mysql 26 | 27 | [ndbd] 28 | NodeId=2 29 | hostname=192.168.0.3 30 | datadir=/var/lib/mysql 31 | 32 | [ndbd] 33 | NodeId=3 34 | hostname=192.168.0.4 35 | datadir=/var/lib/mysql 36 | 37 | [mysqld] 38 | NodeId=4 39 | hostname=192.168.0.10 40 | -------------------------------------------------------------------------------- /mysql-cluster/9.1/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-cluster/9.1/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-cluster:9.1/ } 7 | its('names') { should include "mysql-cluster-9.1" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-cluster-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '9.1.0.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '9.1.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-cluster/9.1/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-cluster/9.2/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-9.2.0 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.2.0 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ 23 | && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol9_appstream \ 29 | --enablerepo=mysql-cluster-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf clean all \ 31 | && mkdir /docker-entrypoint-initdb.d 32 | 33 | COPY prepare-image.sh / 34 | RUN /prepare-image.sh && rm -f /prepare-image.sh 35 | 36 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 37 | 38 | COPY docker-entrypoint.sh /entrypoint.sh 39 | COPY healthcheck.sh /healthcheck.sh 40 | COPY cnf/my.cnf /etc/ 41 | COPY cnf/mysql-cluster.cnf /etc/ 42 | 43 | ENTRYPOINT ["/entrypoint.sh"] 44 | HEALTHCHECK CMD /healthcheck.sh 45 | EXPOSE 3306 33060-33061 2202 1186 46 | CMD ["mysqld"] 47 | 48 | -------------------------------------------------------------------------------- /mysql-cluster/9.2/cnf/my.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [mysqld] 17 | ndbcluster 18 | ndb-connectstring=192.168.0.2 19 | user=mysql 20 | 21 | [mysql_cluster] 22 | ndb-connectstring=192.168.0.2 23 | -------------------------------------------------------------------------------- /mysql-cluster/9.2/cnf/mysql-cluster.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [ndbd default] 17 | NoOfReplicas=2 18 | DataMemory=80M 19 | IndexMemory=18M 20 | 21 | 22 | [ndb_mgmd] 23 | NodeId=1 24 | hostname=192.168.0.2 25 | datadir=/var/lib/mysql 26 | 27 | [ndbd] 28 | NodeId=2 29 | hostname=192.168.0.3 30 | datadir=/var/lib/mysql 31 | 32 | [ndbd] 33 | NodeId=3 34 | hostname=192.168.0.4 35 | datadir=/var/lib/mysql 36 | 37 | [mysqld] 38 | NodeId=4 39 | hostname=192.168.0.10 40 | -------------------------------------------------------------------------------- /mysql-cluster/9.2/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-cluster/9.2/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-cluster:9.2/ } 7 | its('names') { should include "mysql-cluster-9.2" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-cluster-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '9.2.0.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '9.2.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-cluster/9.2/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-cluster/9.3/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-cluster-community-server-minimal-9.3.0 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.3.0 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ 23 | && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol9_appstream \ 29 | --enablerepo=mysql-cluster-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf clean all \ 31 | && mkdir /docker-entrypoint-initdb.d 32 | 33 | COPY prepare-image.sh / 34 | RUN /prepare-image.sh && rm -f /prepare-image.sh 35 | 36 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 37 | 38 | COPY docker-entrypoint.sh /entrypoint.sh 39 | COPY healthcheck.sh /healthcheck.sh 40 | COPY cnf/my.cnf /etc/ 41 | COPY cnf/mysql-cluster.cnf /etc/ 42 | 43 | ENTRYPOINT ["/entrypoint.sh"] 44 | HEALTHCHECK CMD /healthcheck.sh 45 | EXPOSE 3306 33060-33061 2202 1186 46 | CMD ["mysqld"] 47 | 48 | -------------------------------------------------------------------------------- /mysql-cluster/9.3/cnf/my.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [mysqld] 17 | ndbcluster 18 | ndb-connectstring=192.168.0.2 19 | user=mysql 20 | 21 | [mysql_cluster] 22 | ndb-connectstring=192.168.0.2 23 | -------------------------------------------------------------------------------- /mysql-cluster/9.3/cnf/mysql-cluster.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [ndbd default] 17 | NoOfReplicas=2 18 | DataMemory=80M 19 | IndexMemory=18M 20 | 21 | 22 | [ndb_mgmd] 23 | NodeId=1 24 | hostname=192.168.0.2 25 | datadir=/var/lib/mysql 26 | 27 | [ndbd] 28 | NodeId=2 29 | hostname=192.168.0.3 30 | datadir=/var/lib/mysql 31 | 32 | [ndbd] 33 | NodeId=3 34 | hostname=192.168.0.4 35 | datadir=/var/lib/mysql 36 | 37 | [mysqld] 38 | NodeId=4 39 | hostname=192.168.0.10 40 | -------------------------------------------------------------------------------- /mysql-cluster/9.3/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-cluster/9.3/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-cluster:9.3/ } 7 | its('names') { should include "mysql-cluster-9.3" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-cluster-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '9.3.0.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '9.3.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-cluster/9.3/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-cluster/VERSION: -------------------------------------------------------------------------------- 1 | IMAGE_VERSION=1.2.21-cluster 2 | 3 | # LATEST is always set to the 4 | # current highest release, which is, 5 | # either 'innovation' or an LTS series 6 | # i.e. 9.7, or 10.7 7 | 8 | LATEST="innovation" 9 | 10 | 11 | 12 | # LATEST_LTS is set to the highest 13 | # LTS series currently being released 14 | # i.e. when 9.7 release will come it 15 | # will be set to 9.7 up till 10.7 and 16 | # then 10.7 and so on 17 | 18 | LATEST_LTS="8.4" 19 | 20 | 21 | 22 | # The value of key should be series 23 | # i.e. 8.0, 8.4, innovation, 9.7, etc. 24 | # do not use any other value for key 25 | # like 'latest-8.4' or 'lts-84', etch 26 | 27 | declare -A MYSQL_CLUSTER_VERSIONS 28 | MYSQL_CLUSTER_VERSIONS["8.0"]=8.0.42 29 | MYSQL_CLUSTER_VERSIONS["8.4"]=8.4.5 30 | MYSQL_CLUSTER_VERSIONS["innovation"]=9.3.0 31 | 32 | declare -A MYSQL_SHELL_VERSIONS 33 | MYSQL_SHELL_VERSIONS["8.0"]=8.0.42 34 | MYSQL_SHELL_VERSIONS["8.4"]=8.4.5 35 | MYSQL_SHELL_VERSIONS["innovation"]=9.3.0 36 | 37 | declare -A FULL_SERVER_VERSIONS 38 | FULL_SERVER_VERSIONS["8.0"]="${MYSQL_CLUSTER_VERSIONS["8.0"]}-${IMAGE_VERSION}" 39 | FULL_SERVER_VERSIONS["8.4"]="${MYSQL_CLUSTER_VERSIONS["8.4"]}-${IMAGE_VERSION}" 40 | FULL_SERVER_VERSIONS["innovation"]="${MYSQL_CLUSTER_VERSIONS["innovation"]}-${IMAGE_VERSION}" 41 | -------------------------------------------------------------------------------- /mysql-cluster/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | set -e 17 | source ./VERSION 18 | 19 | MAJOR_VERSIONS=("${!MYSQL_CLUSTER_VERSIONS[@]}"); [ -n "$1" ] && MAJOR_VERSIONS=("${@:1}") 20 | 21 | for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do 22 | CLUSTER_VERSION=${MYSQL_CLUSTER_VERSIONS[$MAJOR_VERSION]} 23 | MAJOR_VERSION=${CLUSTER_VERSION%.*} 24 | docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$http_proxy --build-arg no_proxy=$no_proxy -t mysql/mysql-cluster:$MAJOR_VERSION $MAJOR_VERSION 25 | done 26 | -------------------------------------------------------------------------------- /mysql-cluster/changelog: -------------------------------------------------------------------------------- 1 | Changes in 1.1.3 2 | * Added support for new infoschema system user in 8.0.4 3 | * Bumped server versions to 5.5.59, 5.6.39, 5.7.21, 8.0.4 4 | * Bumper cluster versions to 7.5.9, 7.6.4 5 | 6 | Changes in 1.1.2 (2017-10-16) 7 | * Bumped server versions to 5.5.58, 5.6.38, 5.7.20 8 | * Bumped Shell 8.0 version to 8.0.3 9 | 10 | Changes in 1.1.1 (2017-09-22) 11 | * Disable binlog for all entrypoint client commands (#87305) 12 | This was previously only done only for the script to set the root password, 13 | but should be done for all client commands, or group replication will fail 14 | * Add flag for logging to console (#87458) 15 | Setting -e MYSQL_LOG_CONSOLE=true will make the server log to console, so the 16 | server log is available through Docker's log interface. If /etc/my.cnf is 17 | mounted from the host system, this has no effect. On 8.0, this is the default 18 | behavior. 19 | * Ensure both MYSQL_USER and MYSQL_PASSWORD are set (#86982) 20 | Before, setting only one would cause the option to be silently ignored. 21 | * Read password file first and throw error if it is empty (#87025) 22 | Setting MYSQL_ROOT_PASSWORD to an empty string would be rejected, but 23 | setting it to a file with no content would be accepted. Both are now rejected. 24 | * MYSQL_RANDOM_ROOT_PASSWORD and MYSQL_ONETIME_PASSWORD are now set by default. (#87515) 25 | A password option no longer needs to be set explicitly. If none are set, a 26 | random, expired password is set. 27 | * Make root@$MYSQL_ROOT_HOST identical to root@localhost (#86945) 28 | If the MYSQL_ROOT_HOST variable is set we add an additional root user for 29 | the given host. This user was missing the PROXY privilege. We add the 30 | missing privilege so the users are identical. 31 | * MySQL Server 8.0 updated to 8.0.3-rc 32 | * MySQL Shell for 5.7 updated to 1.0.10 33 | 34 | Changes in 1.1.0 (2017-07-24) 35 | * Fixed broken MYSQL_ONETIME_PASSWORD support (#86523) 36 | The functionality wasn't correctly updated when the entrypoint script was 37 | changed to only create the root@localhost user by default 38 | * Changed control files to be generated from a common template 39 | The control files for each version will be generated by swapping out the few 40 | commands that differ between server versions 41 | * Made PACKAGE_URL an ARG entry, to allow build-time changing 42 | The URL variables can be changed by supplying new ones with --build-arg at 43 | build time 44 | * Added basic healthcheck script 45 | Once database init is complete a flag file will be touched. If this file 46 | exists and mysqladmin ping succeeds, the container is reported as healthy, 47 | meaning it is ready for use 48 | * Database init will now use configured socket setting instead of hardcoded 49 | Using a hardcoded socket could cause init scripts to fail in confusing ways 50 | if the user customized the socket setting 51 | * Added MySQL Shell to supported images 52 | For 5.7 and 8.0, MySQL Shell is installed together with the server. 53 | https://dev.mysql.com/doc/refman/5.7/en/mysql-shell.html 54 | 55 | Known issues: 56 | * For existing databases created with older images/not with Docker, the 57 | healthcheck script will generate an "Access denied for healthchecker@localhost" 58 | message in the server log every time it runs. If connection throttling is 59 | enabled this could eventually cause the healthcheck to fail 60 | -------------------------------------------------------------------------------- /mysql-cluster/tag.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | set -e 17 | source VERSION 18 | 19 | MAJOR_VERSIONS=("${!MYSQL_CLUSTER_VERSIONS[@]}"); [ -n "$1" ] && MAJOR_VERSIONS=("${@:1}") 20 | 21 | for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do 22 | CLUSTER_VERSION=${MYSQL_CLUSTER_VERSIONS[$MAJOR_VERSION]} 23 | FULL_VERSION=${FULL_SERVER_VERSIONS[$MAJOR_VERSION]} 24 | MAJOR_VERSION=${CLUSTER_VERSION%.*} 25 | TAGS="$MAJOR_VERSION $CLUSTER_VERSION $FULL_VERSION" 26 | 27 | if [ "$MAJOR_VERSION" = "$LATEST" ]; then 28 | TAGS="latest $TAGS" 29 | fi 30 | 31 | echo $TAGS 32 | done 33 | -------------------------------------------------------------------------------- /mysql-cluster/template/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% 19 | ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U %%REPO%%/%%CONFIG_PACKAGE_NAME_MINIMAL%% \ 23 | && rpm -U %%REPO%%/%%CONFIG_PACKAGE_NAME%% 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=%%REPO_NAME_TOOLS%% $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol9_appstream \ 29 | --enablerepo=%%REPO_NAME_SERVER%% $MYSQL_SERVER_PACKAGE \ 30 | && microdnf clean all \ 31 | && mkdir /docker-entrypoint-initdb.d 32 | 33 | COPY prepare-image.sh / 34 | RUN /prepare-image.sh && rm -f /prepare-image.sh 35 | 36 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 37 | 38 | COPY docker-entrypoint.sh /entrypoint.sh 39 | COPY healthcheck.sh /healthcheck.sh 40 | COPY cnf/my.cnf /etc/ 41 | COPY cnf/mysql-cluster.cnf /etc/ 42 | 43 | ENTRYPOINT ["/entrypoint.sh"] 44 | HEALTHCHECK CMD /healthcheck.sh 45 | EXPOSE %%PORTS%% 46 | CMD ["mysqld"] 47 | 48 | -------------------------------------------------------------------------------- /mysql-cluster/template/Dockerfile-pre8: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:7-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% 19 | ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U %%REPO%%/mysql-cluster-community-minimal-release-el7.rpm \ 23 | && rpm -U %%REPO%%/mysql80-community-release-el7.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN yum install -y $MYSQL_SHELL_PACKAGE \ 27 | && yum install -y $MYSQL_SERVER_PACKAGE --enablerepo=mysql-cluster%%REPO_VERSION%%-community-minimal\ 28 | && yum clean all \ 29 | && mkdir /docker-entrypoint-initdb.d 30 | 31 | COPY prepare-image.sh / 32 | RUN /prepare-image.sh && rm -f /prepare-image.sh 33 | 34 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 35 | 36 | COPY docker-entrypoint.sh /entrypoint.sh 37 | COPY healthcheck.sh /healthcheck.sh 38 | COPY cnf/my.cnf /etc/ 39 | COPY cnf/mysql-cluster.cnf /etc/ 40 | 41 | ENTRYPOINT ["/entrypoint.sh"] 42 | HEALTHCHECK CMD /healthcheck.sh 43 | EXPOSE %%PORTS%% 44 | CMD ["mysqld"] 45 | 46 | -------------------------------------------------------------------------------- /mysql-cluster/template/cnf/my.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [mysqld] 17 | ndbcluster 18 | ndb-connectstring=192.168.0.2 19 | user=mysql 20 | 21 | [mysql_cluster] 22 | ndb-connectstring=192.168.0.2 23 | -------------------------------------------------------------------------------- /mysql-cluster/template/cnf/mysql-cluster.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | [ndbd default] 17 | NoOfReplicas=2 18 | DataMemory=80M 19 | IndexMemory=18M 20 | 21 | 22 | [ndb_mgmd] 23 | NodeId=1 24 | hostname=192.168.0.2 25 | datadir=/var/lib/mysql 26 | 27 | [ndbd] 28 | NodeId=2 29 | hostname=192.168.0.3 30 | datadir=/var/lib/mysql 31 | 32 | [ndbd] 33 | NodeId=3 34 | hostname=192.168.0.4 35 | datadir=/var/lib/mysql 36 | 37 | [mysqld] 38 | NodeId=4 39 | hostname=192.168.0.10 40 | -------------------------------------------------------------------------------- /mysql-cluster/template/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-cluster:%%MAJOR_VERSION%%/ } 7 | its('names') { should include "mysql-cluster-%%MAJOR_VERSION%%" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('%%MYSQL_SERVER_PACKAGE_NAME%%') do 13 | it { should be_installed } 14 | its ('version') { should match '%%MYSQL_VERSION%%.*' } 15 | end 16 | describe package('%%MYSQL_SHELL_PACKAGE_NAME%%') do 17 | it { should be_installed } 18 | its ('version') { should match '%%MYSQL_SHELL_VERSION%%.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-cluster/template/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-cluster/template/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-cluster/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # This script will simply use sed to replace placeholder variables in the 18 | # files in template/ with version-specific variants. 19 | 20 | set -e 21 | source VERSION 22 | 23 | MAJOR_VERSIONS=("${!MYSQL_CLUSTER_VERSIONS[@]}"); [ -n "$1" ] && MAJOR_VERSIONS=("${@:1}") 24 | 25 | for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do 26 | CLUSTER_VERSION=${MYSQL_CLUSTER_VERSIONS[$MAJOR_VERSION]} 27 | MAJOR_VERSION=${CLUSTER_VERSION%.*} 28 | podman run -d --rm --name "mysql-cluster-$MAJOR_VERSION" "mysql/mysql-cluster:$MAJOR_VERSION" 29 | export DOCKER_HOST=unix:///tmp/podman.sock 30 | podman system service --time=0 ${DOCKER_HOST} & DOCKER_SOCK_PID="$!" 31 | inspec exec --no-color $MAJOR_VERSION/inspec/control.rb --controls container 32 | inspec exec --no-color $MAJOR_VERSION/inspec/control.rb -t "docker://mysql-cluster-$MAJOR_VERSION" --controls packages 33 | podman stop -i "mysql-cluster-$MAJOR_VERSION" 34 | podman rm -i -f "mysql-cluster-$MAJOR_VERSION" 35 | kill -TERM ${DOCKER_SOCK_PID} 36 | rm -f /tmp/podman.sock 37 | done 38 | -------------------------------------------------------------------------------- /mysql-router/8.0/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2018, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 16 | 17 | ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.0.42 18 | ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.0.42 19 | ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm 20 | ARG REPO_NAME_SERVER=mysql80-community 21 | ARG REPO_NAME_TOOLS=mysql-tools-community 22 | 23 | RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ 24 | && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ 25 | -c "MySQL Router" mysqlrouter \ 26 | && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ 27 | && microdnf install -y \ 28 | --enablerepo=mysql80-community $MYSQL_CLIENT_PACKAGE \ 29 | && microdnf install -y --disablerepo=\* \ 30 | --enablerepo=mysql-tools-community $MYSQL_ROUTER_PACKAGE \ 31 | && microdnf clean all 32 | 33 | COPY run.sh /run.sh 34 | HEALTHCHECK \ 35 | CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 36 | EXPOSE 6446 6447 6448 6449 6450 8443 37 | USER 999:999 38 | ENTRYPOINT ["/run.sh"] 39 | CMD ["mysqlrouter"] 40 | -------------------------------------------------------------------------------- /mysql-router/8.0/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /sleep/ } 6 | its('images') { should cmp /mysql-router:8.0/ } 7 | its('names') { should include "mysql-router-8.0" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-client') do 13 | it { should be_installed } 14 | its ('version') { should match '8.0.42.*' } 15 | end 16 | describe package('mysql-router-community') do 17 | it { should be_installed } 18 | its ('version') { should match '8.0.42.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-router/8.1/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2018, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | FROM container-registry.oracle.com/os/oraclelinux:8-slim 16 | 17 | ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.1.0 18 | ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.1.0 19 | ARG CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm 20 | ARG REPO_NAME_SERVER=mysql-innovation-community 21 | ARG REPO_NAME_TOOLS=mysql-tools-innovation-community 22 | 23 | RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ 24 | && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ 25 | -c "MySQL Router" mysqlrouter \ 26 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ 27 | && microdnf install -y --disablerepo=\* \ 28 | --enablerepo=mysql-innovation-community $MYSQL_CLIENT_PACKAGE \ 29 | && microdnf install -y --disablerepo=\* \ 30 | --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ 31 | && microdnf clean all 32 | 33 | COPY run.sh /run.sh 34 | HEALTHCHECK \ 35 | CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 36 | EXPOSE 6446 6447 6448 6449 8443 37 | USER 999:999 38 | ENTRYPOINT ["/run.sh"] 39 | CMD ["mysqlrouter"] 40 | -------------------------------------------------------------------------------- /mysql-router/8.1/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /sleep/ } 6 | its('images') { should cmp /mysql-router:8.1/ } 7 | its('names') { should include "mysql-router-8.1" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-client') do 13 | it { should be_installed } 14 | its ('version') { should match '8.1.0.*' } 15 | end 16 | describe package('mysql-router-community') do 17 | it { should be_installed } 18 | its ('version') { should match '8.1.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-router/8.2/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2018, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | FROM container-registry.oracle.com/os/oraclelinux:8-slim 16 | 17 | ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.2.0 18 | ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.2.0 19 | ARG CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm 20 | ARG REPO_NAME_SERVER=mysql-innovation-community 21 | ARG REPO_NAME_TOOLS=mysql-tools-innovation-community 22 | 23 | RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ 24 | && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ 25 | -c "MySQL Router" mysqlrouter \ 26 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ 27 | && microdnf install -y --disablerepo=\* \ 28 | --enablerepo=mysql-innovation-community $MYSQL_CLIENT_PACKAGE \ 29 | && microdnf install -y --disablerepo=\* \ 30 | --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ 31 | && microdnf clean all 32 | 33 | COPY run.sh /run.sh 34 | HEALTHCHECK \ 35 | CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 36 | EXPOSE 6446 6447 6448 6449 8443 37 | USER 999:999 38 | ENTRYPOINT ["/run.sh"] 39 | CMD ["mysqlrouter"] 40 | -------------------------------------------------------------------------------- /mysql-router/8.2/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /sleep/ } 6 | its('images') { should cmp /mysql-router:8.2/ } 7 | its('names') { should include "mysql-router-8.2" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-client') do 13 | it { should be_installed } 14 | its ('version') { should match '8.2.0.*' } 15 | end 16 | describe package('mysql-router-community') do 17 | it { should be_installed } 18 | its ('version') { should match '8.2.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-router/8.3/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2018, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | FROM container-registry.oracle.com/os/oraclelinux:8-slim 16 | 17 | ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.3.0 18 | ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.3.0 19 | ARG CONFIG_PACKAGE_NAME=mysql80-community-release-el8.rpm 20 | ARG REPO_NAME_SERVER=mysql-innovation-community 21 | ARG REPO_NAME_TOOLS=mysql-tools-innovation-community 22 | 23 | RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ 24 | && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ 25 | -c "MySQL Router" mysqlrouter \ 26 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ 27 | && microdnf install -y --disablerepo=\* \ 28 | --enablerepo=mysql-innovation-community $MYSQL_CLIENT_PACKAGE \ 29 | && microdnf install -y --disablerepo=\* \ 30 | --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ 31 | && microdnf clean all 32 | 33 | COPY run.sh /run.sh 34 | HEALTHCHECK \ 35 | CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 36 | EXPOSE 6446 6447 6448 6449 6450 8443 37 | USER 999:999 38 | ENTRYPOINT ["/run.sh"] 39 | CMD ["mysqlrouter"] 40 | -------------------------------------------------------------------------------- /mysql-router/8.3/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /sleep/ } 6 | its('images') { should cmp /mysql-router:8.3/ } 7 | its('names') { should include "mysql-router-8.3" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-client') do 13 | it { should be_installed } 14 | its ('version') { should match '8.3.0.*' } 15 | end 16 | describe package('mysql-router-community') do 17 | it { should be_installed } 18 | its ('version') { should match '8.3.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-router/8.4/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2018, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 16 | 17 | ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-8.4.5 18 | ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-8.4.5 19 | ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm 20 | ARG REPO_NAME_SERVER=mysql-8.4-lts-community 21 | ARG REPO_NAME_TOOLS=mysql-tools-8.4-lts-community 22 | 23 | RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ 24 | && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ 25 | -c "MySQL Router" mysqlrouter \ 26 | && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ 27 | && microdnf install -y \ 28 | --enablerepo=mysql-8.4-lts-community $MYSQL_CLIENT_PACKAGE \ 29 | && microdnf install -y --disablerepo=\* \ 30 | --enablerepo=mysql-tools-8.4-lts-community $MYSQL_ROUTER_PACKAGE \ 31 | && microdnf clean all 32 | 33 | COPY run.sh /run.sh 34 | HEALTHCHECK \ 35 | CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 36 | EXPOSE 6446 6447 6448 6449 6450 8443 37 | USER 999:999 38 | ENTRYPOINT ["/run.sh"] 39 | CMD ["mysqlrouter"] 40 | -------------------------------------------------------------------------------- /mysql-router/8.4/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /sleep/ } 6 | its('images') { should cmp /mysql-router:8.4/ } 7 | its('names') { should include "mysql-router-8.4" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-client') do 13 | it { should be_installed } 14 | its ('version') { should match '8.4.5.*' } 15 | end 16 | describe package('mysql-router-community') do 17 | it { should be_installed } 18 | its ('version') { should match '8.4.5.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-router/9.0/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2018, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 16 | 17 | ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-9.0.1 18 | ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-9.0.1 19 | ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm 20 | ARG REPO_NAME_SERVER=mysql-innovation-community 21 | ARG REPO_NAME_TOOLS=mysql-tools-innovation-community 22 | 23 | RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ 24 | && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ 25 | -c "MySQL Router" mysqlrouter \ 26 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ 27 | && microdnf install -y \ 28 | --enablerepo=mysql-innovation-community $MYSQL_CLIENT_PACKAGE \ 29 | && microdnf install -y --disablerepo=\* \ 30 | --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ 31 | && microdnf clean all 32 | 33 | COPY run.sh /run.sh 34 | HEALTHCHECK \ 35 | CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 36 | EXPOSE 6446 6447 6448 6449 6450 8443 37 | USER 999:999 38 | ENTRYPOINT ["/run.sh"] 39 | CMD ["mysqlrouter"] 40 | -------------------------------------------------------------------------------- /mysql-router/9.0/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /sleep/ } 6 | its('images') { should cmp /mysql-router:9.0/ } 7 | its('names') { should include "mysql-router-9.0" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-client') do 13 | it { should be_installed } 14 | its ('version') { should match '9.0.1.*' } 15 | end 16 | describe package('mysql-router-community') do 17 | it { should be_installed } 18 | its ('version') { should match '9.0.1.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-router/9.1/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2018, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 16 | 17 | ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-9.1.0 18 | ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-9.1.0 19 | ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm 20 | ARG REPO_NAME_SERVER=mysql-innovation-community 21 | ARG REPO_NAME_TOOLS=mysql-tools-innovation-community 22 | 23 | RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ 24 | && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ 25 | -c "MySQL Router" mysqlrouter \ 26 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ 27 | && microdnf install -y \ 28 | --enablerepo=mysql-innovation-community $MYSQL_CLIENT_PACKAGE \ 29 | && microdnf install -y --disablerepo=\* \ 30 | --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ 31 | && microdnf clean all 32 | 33 | COPY run.sh /run.sh 34 | HEALTHCHECK \ 35 | CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 36 | EXPOSE 6446 6447 6448 6449 6450 8443 37 | USER 999:999 38 | ENTRYPOINT ["/run.sh"] 39 | CMD ["mysqlrouter"] 40 | -------------------------------------------------------------------------------- /mysql-router/9.1/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /sleep/ } 6 | its('images') { should cmp /mysql-router:9.1/ } 7 | its('names') { should include "mysql-router-9.1" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-client') do 13 | it { should be_installed } 14 | its ('version') { should match '9.1.0.*' } 15 | end 16 | describe package('mysql-router-community') do 17 | it { should be_installed } 18 | its ('version') { should match '9.1.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-router/9.2/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2018, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 16 | 17 | ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-9.2.0 18 | ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-9.2.0 19 | ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm 20 | ARG REPO_NAME_SERVER=mysql-innovation-community 21 | ARG REPO_NAME_TOOLS=mysql-tools-innovation-community 22 | 23 | RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ 24 | && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ 25 | -c "MySQL Router" mysqlrouter \ 26 | && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ 27 | && microdnf install -y \ 28 | --enablerepo=mysql-innovation-community $MYSQL_CLIENT_PACKAGE \ 29 | && microdnf install -y --disablerepo=\* \ 30 | --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ 31 | && microdnf clean all 32 | 33 | COPY run.sh /run.sh 34 | HEALTHCHECK \ 35 | CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 36 | EXPOSE 6446 6447 6448 6449 6450 8443 37 | USER 999:999 38 | ENTRYPOINT ["/run.sh"] 39 | CMD ["mysqlrouter"] 40 | -------------------------------------------------------------------------------- /mysql-router/9.2/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /sleep/ } 6 | its('images') { should cmp /mysql-router:9.2/ } 7 | its('names') { should include "mysql-router-9.2" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-client') do 13 | it { should be_installed } 14 | its ('version') { should match '9.2.0.*' } 15 | end 16 | describe package('mysql-router-community') do 17 | it { should be_installed } 18 | its ('version') { should match '9.2.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-router/9.3/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2018, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 16 | 17 | ARG MYSQL_CLIENT_PACKAGE=mysql-community-client-9.3.0 18 | ARG MYSQL_ROUTER_PACKAGE=mysql-router-community-9.3.0 19 | ARG CONFIG_PACKAGE_NAME=mysql84-community-release-el9.rpm 20 | ARG REPO_NAME_SERVER=mysql-innovation-community 21 | ARG REPO_NAME_TOOLS=mysql-tools-innovation-community 22 | 23 | RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ 24 | && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ 25 | -c "MySQL Router" mysqlrouter \ 26 | && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/$CONFIG_PACKAGE_NAME \ 27 | && microdnf install -y \ 28 | --enablerepo=mysql-innovation-community $MYSQL_CLIENT_PACKAGE \ 29 | && microdnf install -y --disablerepo=\* \ 30 | --enablerepo=mysql-tools-innovation-community $MYSQL_ROUTER_PACKAGE \ 31 | && microdnf clean all 32 | 33 | COPY run.sh /run.sh 34 | HEALTHCHECK \ 35 | CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 36 | EXPOSE 6446 6447 6448 6449 6450 8443 37 | USER 999:999 38 | ENTRYPOINT ["/run.sh"] 39 | CMD ["mysqlrouter"] 40 | -------------------------------------------------------------------------------- /mysql-router/9.3/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /sleep/ } 6 | its('images') { should cmp /mysql-router:9.3/ } 7 | its('names') { should include "mysql-router-9.3" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-client') do 13 | it { should be_installed } 14 | its ('version') { should match '9.3.0.*' } 15 | end 16 | describe package('mysql-router-community') do 17 | it { should be_installed } 18 | its ('version') { should match '9.3.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-router/README.md: -------------------------------------------------------------------------------- 1 | ![logo](https://www.mysql.com/common/logos/logo-mysql-170x115.png) 2 | 3 | # What is MySQL Router? 4 | 5 | MySQL Router is part of InnoDB cluster, and is lightweight middleware that 6 | provides transparent routing between your application and back-end MySQL 7 | Servers. It can be used for a wide variety of use cases, such as providing high 8 | availability and scalability by effectively routing database traffic to 9 | appropriate back-end MySQL Servers. The pluggable architecture also enables 10 | developers to extend MySQL Router for custom use cases. 11 | 12 | # Supported Tags and Respective Dockerfile Links 13 | 14 | * MySQL Router 8.0 (tag: [`latest`, `8.0`](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) ([mysql-router/8.0/Dockerfile](https://github.com/mysql/mysql-docker/blob/mysql-router/8.0/Dockerfile)) 15 | 16 | Images are updated when new MySQL Server maintenance releases and development milestones are published. Please note that non-GA releases are for preview purposes only and should not be used in production setups. 17 | 18 | # How to Use the MySQL Router Images 19 | 20 | The image currently uses the following mandatory variables: 21 | 22 | | Variable | Description | 23 | | ------------------------ | ------------------------------------------- | 24 | | MYSQL_HOST | MySQL host to connect to | 25 | | MYSQL_PORT | Port to use | 26 | | MYSQL_USER | User to connect with | 27 | | MYSQL_PASSWORD | Password to connect with | 28 | 29 | Running in a container requires a working InnoDB cluster. 30 | 31 | The image uses the following optional variables: 32 | 33 | | Variable | Description | 34 | | ------------------------------------ | ------------------------------------------- | 35 | | MYSQL_INNODB_CLUSTER_MEMBERS | Wait for at least this number of cluster instances to be ONLINE | 36 | | MYSQL_CREATE_ROUTER_USER | Whether to create a new account for the Router to use when it's running. Defaults to 1, set to 0 to disable. | 37 | | MYSQL_ROUTER_BOOTSTRAP_EXTRA_OPTIONS | Additional command line options applied while bootstrapping 38 | 39 | If supplied the run script waits for the given mysql host to be up, the InnoDB cluster to have 40 | MYSQL_INNODB_CLUSTER_MEMBERS members and then uses the given server for its 41 | bootstrap mode 42 | [Bootstrapping](https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-deploying-bootstrapping.html). 43 | 44 | The image can be run via: 45 | 46 | ``` 47 | docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_INNODB_CLUSTER_MEMBERS=3 -ti mysql/mysql-router 48 | ``` 49 | 50 | Additional command line options for running MySQL Router after bootstrap can be passed a command options. For instance you can use a config file from your home directory like this: 51 | 52 | ``` 53 | docker run -e MYSQL_HOST=localhost -e MYSQL_PORT=3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -ti -v $HOME/router-extra.conf:/tmp/router-extra.conf mysql/mysql-router mysqlrouter --extra-config=/tmp/router-extra.conf 54 | ``` 55 | 56 | It can be verified by typing: 57 | 58 | ``` 59 | docker ps 60 | ``` 61 | 62 | The following output should be displayed: 63 | 64 | ``` 65 | 4954b1c80be1 mysql-router:8.0 "/run.sh mysqlrouter" About a minute ago Up About a minute (healthy) 6447/tcp, 6448/tcp, 0.0.0.0:6446->6446/tcp, 6449/tcp innodbcluster_mysql-router_1 66 | ``` 67 | 68 | By default the container will run as user 999:999 which maps to mysqlrouter:mysqlrouter inside the container. 69 | 70 | # Exposed Ports 71 | 72 | The following TCP ports are exposed by the MySQL Router container: 73 | 74 | | Port | Description 75 | | ----- | --------------------------------------------------------------------------------------- | 76 | | 6446 | R/W connection port. Clients that connect to this port will be forwarded to the PRIMARY | 77 | | 6447 | R/O connection port. Clients that connect to this port will be forwarded to a SECONDARY | 78 | | 6448 | X Protocol R/W connection port. R/W port for X protocol client connections | 79 | | 6449 | X Protocol R/O connection port. R/O port for X protocol client connections | 80 | | 8443 | HTTPS REST interface port. | 81 | 82 | For more information about the REST interface API, see: 83 | 84 | https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-rest-api-reference.html 85 | 86 | For full usage documentation, see: 87 | 88 | https://dev.mysql.com/doc/mysql-router/8.0/en/mysql-router-installation-docker.html 89 | -------------------------------------------------------------------------------- /mysql-router/VERSION: -------------------------------------------------------------------------------- 1 | IMAGE_VERSION=1.0.21-router 2 | 3 | # LATEST is always set to the 4 | # current highest release, which is, 5 | # either 'innovation' or an LTS series 6 | # i.e. 9.7, or 10.7 7 | 8 | LATEST="innovation" 9 | 10 | 11 | 12 | # LATEST_LTS is set to the highest 13 | # LTS series currently being released 14 | # i.e. when 9.7 release will come it 15 | # will be set to 9.7 up till 10.7 and 16 | # then 10.7 and so on 17 | 18 | LATEST_LTS="8.4" 19 | 20 | 21 | 22 | # The value of key should be series 23 | # i.e. 8.0, 8.4, innovation, 9.7, etc. 24 | # do not use any other value for key 25 | # like 'latest-8.4' or 'lts-84', etch 26 | 27 | declare -A MYSQL_ROUTER_VERSIONS WEEKLY_ROUTER_VERSIONS 28 | MYSQL_ROUTER_VERSIONS["8.0"]=8.0.42 29 | MYSQL_ROUTER_VERSIONS["8.4"]=8.4.5 30 | MYSQL_ROUTER_VERSIONS["innovation"]=9.3.0 31 | 32 | WEEKLY_ROUTER_VERSIONS["8.0"]=8.0.43 33 | WEEKLY_ROUTER_VERSIONS["8.4"]=8.4.6 34 | WEEKLY_ROUTER_VERSIONS["innovation"]=9.4.0 35 | 36 | declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS 37 | MYSQL_SERVER_VERSIONS["8.0"]=8.0.42 38 | MYSQL_SERVER_VERSIONS["8.4"]=8.4.5 39 | MYSQL_SERVER_VERSIONS["innovation"]=9.3.0 40 | 41 | WEEKLY_SERVER_VERSIONS["8.0"]=8.0.43 42 | WEEKLY_SERVER_VERSIONS["8.4"]=8.4.6 43 | WEEKLY_SERVER_VERSIONS["innovation"]=9.4.0 44 | -------------------------------------------------------------------------------- /mysql-router/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2018, 2023 Oracle and/or its affiliates. All rights reserved. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | set -e 17 | source ./VERSION 18 | 19 | ARCH=amd64; [ -n "$1" ] && ARCH=$1 20 | WEEKLY=''; [ -n "$2" ] && WEEKLY=$2 21 | MAJOR_VERSIONS=("${!MYSQL_ROUTER_VERSIONS[@]}"); [ -n "$3" ] && MAJOR_VERSIONS=("${@:3}") 22 | 23 | for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do 24 | if [ "$WEEKLY" == "1" ]; then 25 | ROUTER_VERSION=${WEEKLY_ROUTER_VERSIONS["${MAJOR_VERSION}"]} 26 | else 27 | ROUTER_VERSION=${MYSQL_ROUTER_VERSIONS["${MAJOR_VERSION}"]} 28 | fi 29 | MAJOR_VERSION=${ROUTER_VERSION%.*} 30 | docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$http_proxy --build-arg no_proxy=$no_proxy -t mysql/mysql-router:$MAJOR_VERSION-$ARCH $MAJOR_VERSION 31 | done 32 | -------------------------------------------------------------------------------- /mysql-router/gen_dockerfiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | set -e 4 | 5 | source ./VERSION 6 | 7 | REPO=https://repo.mysql.com; [ -n "$1" ] && REPO=$1 8 | CONFIG_PACKAGE_NAME=mysql80-community-release-el9.rpm; [ -n "$2" ] && CONFIG_PACKAGE_NAME=$2 9 | MYSQL_CLIENT_PACKAGE_NAME=mysql-community-client; [ -n "$3" ] && MYSQL_CLIENT_PACKAGE_NAME=$3 10 | MYSQL_ROUTER_PACKAGE_NAME=mysql-router-community; [ -n "$4" ] && MYSQL_ROUTER_PACKAGE_NAME=$4 11 | MYSQL_CLIENT_VERSION=mysql-community-client; [ -n "$5" ] && MYSQL_CLIENT_VERSION=$5 12 | MYSQL_ROUTER_VERSION=mysql-router-community; [ -n "$6" ] && MYSQL_ROUTER_VERSION=$6 13 | REPO_NAME_SERVER=mysql80-community; [ -n "$7" ] && REPO_NAME_SERVER=$7 14 | REPO_NAME_TOOLS=mysql-tools-community; [ -n "$8" ] && REPO_NAME_TOOLS=$8 15 | 16 | MAJOR_VERSION=$(echo $MYSQL_CLIENT_VERSION | cut -d'.' -f'1,2') 17 | 18 | MYSQL_CLIENT_PACKAGE=$MYSQL_CLIENT_PACKAGE_NAME-$MYSQL_CLIENT_VERSION 19 | MYSQL_ROUTER_PACKAGE=$MYSQL_ROUTER_PACKAGE_NAME-$MYSQL_ROUTER_VERSION 20 | 21 | echo "In the place" 22 | echo `ls` 23 | if [ ! -d "${MAJOR_VERSION}" ]; then 24 | mkdir -p "${MAJOR_VERSION}/inspec" 25 | fi 26 | 27 | sed 's#%%MYSQL_CLIENT_PACKAGE%%#'"${MYSQL_CLIENT_PACKAGE}"'#g' template/Dockerfile > tmpFile 28 | sed -i 's#%%MYSQL_ROUTER_PACKAGE%%#'"${MYSQL_ROUTER_PACKAGE}"'#g' tmpFile 29 | sed -i 's#%%CONFIG_PACKAGE_NAME%%#'"${CONFIG_PACKAGE_NAME}"'#g' tmpFile 30 | sed -i 's#%%REPO%%#'"${REPO}"'#g' tmpFile 31 | sed -i 's#%%REPO_NAME_SERVER%%#'"${REPO_NAME_SERVER}"'#g' tmpFile 32 | sed -i 's#%%REPO_NAME_TOOLS%%#'"${REPO_NAME_TOOLS}"'#g' tmpFile 33 | mv tmpFile ${MAJOR_VERSION}/Dockerfile 34 | 35 | # update test template 36 | sed -e 's#%%MYSQL_CLIENT_PACKAGE_NAME%%#'"${MYSQL_CLIENT_PACKAGE_NAME}"'#g' template/control.rb > tmpFile 37 | sed -i -e 's#%%MYSQL_CLIENT_VERSION%%#'"${MYSQL_CLIENT_VERSION}"'#g' tmpFile 38 | sed -i -e 's#%%MYSQL_ROUTER_PACKAGE_NAME%%#'"${MYSQL_ROUTER_PACKAGE_NAME}"'#g' tmpFile 39 | sed -i -e 's#%%MYSQL_ROUTER_VERSION%%#'"${MYSQL_ROUTER_VERSION}"'#g' tmpFile 40 | sed -i -e 's#%%MAJOR_VERSION%%#'"${MAJOR_VERSION}"'#g' tmpFile 41 | mv tmpFile "${MAJOR_VERSION}/inspec/control.rb" 42 | 43 | # copy entrypoint script 44 | cp template/run.sh ${MAJOR_VERSION}/run.sh 45 | chmod +x ${MAJOR_VERSION}/run.sh 46 | 47 | cp README.md ${MAJOR_VERSION}/ 48 | -------------------------------------------------------------------------------- /mysql-router/manifest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2018, 2023 Oracle and/or its affiliates. All rights reserved. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | set -e 17 | source ./VERSION 18 | 19 | if grep -q Microsoft /proc/version; then 20 | echo "Running on Windows Subsystem for Linux" 21 | # WSL doesn't have its own docker host, we have to use the one 22 | # from Windows itself. 23 | # https://medium.com/@sebagomez/installing-the-docker-client-on-ubuntus-windows-subsystem-for-linux-612b392a44c4 24 | export DOCKER_HOST=localhost:2375 25 | fi 26 | 27 | REPO=mysql/mysql-router; [ -n "$1" ] && REPO=$1 28 | MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") 29 | 30 | WEEKLY=0 31 | 32 | if [[ "$REPO" =~ (weekly) ]]; then 33 | WEEKLY=1 34 | fi 35 | 36 | MANIFEST_VERSIONS=$(./tag.sh "" "$WEEKLY" "${MAJOR_VERSIONS[@]}") 37 | for MANIFEST_VERSION in $MANIFEST_VERSIONS; do 38 | docker pull "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" 39 | docker manifest create "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" 40 | docker manifest add "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" --os linux --arch arm64 41 | docker manifest add "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-amd64" --os linux --arch amd64 42 | docker manifest push "$REPO:$MANIFEST_VERSION" "docker://$REPO:$MANIFEST_VERSION" 43 | done 44 | -------------------------------------------------------------------------------- /mysql-router/tag.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, 2023 Oracle and/or its affiliates. 3 | # 4 | set -e 5 | source VERSION 6 | 7 | SUFFIX='' [ -n "$1" ] && SUFFIX=$1 8 | WEEKLY='' [ -n "$2" ] && WEEKLY=$2 9 | MAJOR_VERSIONS=("${!MYSQL_ROUTER_VERSIONS[@]}"); [ -n "$3" ] && MAJOR_VERSIONS=("${@:3}") 10 | 11 | for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do 12 | if [ "$WEEKLY" == "1" ]; then 13 | ROUTER_VERSION=${WEEKLY_ROUTER_VERSIONS["${MAJOR_VERSION}"]} 14 | else 15 | ROUTER_VERSION=${MYSQL_ROUTER_VERSIONS["${MAJOR_VERSION}"]} 16 | fi 17 | FULL_ROUTER_VERSION="${ROUTER_VERSION}-${IMAGE_VERSION}" 18 | MAJOR_VERSION=${ROUTER_VERSION%.*} 19 | TAGS="${MAJOR_VERSION}${SUFFIX} ${ROUTER_VERSION}${SUFFIX} ${FULL_ROUTER_VERSION}${SUFFIX}" 20 | if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then 21 | TAGS="$TAGS latest${SUFFIX}" 22 | fi 23 | echo $TAGS 24 | done 25 | -------------------------------------------------------------------------------- /mysql-router/template/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2018, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 16 | 17 | ARG MYSQL_CLIENT_PACKAGE=%%MYSQL_CLIENT_PACKAGE%% 18 | ARG MYSQL_ROUTER_PACKAGE=%%MYSQL_ROUTER_PACKAGE%% 19 | ARG CONFIG_PACKAGE_NAME=%%CONFIG_PACKAGE_NAME%% 20 | ARG REPO_NAME_SERVER=%%REPO_NAME_SERVER%% 21 | ARG REPO_NAME_TOOLS=%%REPO_NAME_TOOLS%% 22 | 23 | RUN /usr/sbin/groupadd -g 999 -r mysqlrouter >/dev/null \ 24 | && /usr/sbin/useradd -M -N -u 999 -g mysqlrouter -r -d /var/lib/mysqlrouter -s /bin/false \ 25 | -c "MySQL Router" mysqlrouter \ 26 | && rpm -U %%REPO%%/$CONFIG_PACKAGE_NAME \ 27 | && microdnf install -y \ 28 | --enablerepo=%%REPO_NAME_SERVER%% $MYSQL_CLIENT_PACKAGE \ 29 | && microdnf install -y --disablerepo=\* \ 30 | --enablerepo=%%REPO_NAME_TOOLS%% $MYSQL_ROUTER_PACKAGE \ 31 | && microdnf clean all 32 | 33 | COPY run.sh /run.sh 34 | HEALTHCHECK \ 35 | CMD mysqladmin --port 6446 --protocol TCP ping 2>&1 | grep Access || exit 1 36 | EXPOSE 6446 6447 6448 6449 6450 8443 37 | USER 999:999 38 | ENTRYPOINT ["/run.sh"] 39 | CMD ["mysqlrouter"] 40 | -------------------------------------------------------------------------------- /mysql-router/template/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /sleep/ } 6 | its('images') { should cmp /mysql-router:%%MAJOR_VERSION%%/ } 7 | its('names') { should include "mysql-router-%%MAJOR_VERSION%%" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('%%MYSQL_CLIENT_PACKAGE_NAME%%') do 13 | it { should be_installed } 14 | its ('version') { should match '%%MYSQL_CLIENT_VERSION%%.*' } 15 | end 16 | describe package('%%MYSQL_ROUTER_PACKAGE_NAME%%') do 17 | it { should be_installed } 18 | its ('version') { should match '%%MYSQL_ROUTER_VERSION%%.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-router/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2018, 2023, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # This script will simply use sed to replace placeholder variables in the 18 | # files in template/ with version-specific variants. 19 | 20 | set -e 21 | source ./VERSION 22 | 23 | ARCH=amd64; [ -n "$1" ] && ARCH=$1 24 | WEEKLY=''; [ -n "$2" ] && WEEKLY=$2 25 | MAJOR_VERSIONS=("${!MYSQL_ROUTER_VERSIONS[@]}"); [ -n "$3" ] && MAJOR_VERSIONS=("${@:3}") 26 | 27 | for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do 28 | if [ "$WEEKLY" == "1" ]; then 29 | ROUTER_VERSION=${WEEKLY_ROUTER_VERSIONS["${MAJOR_VERSION}"]} 30 | else 31 | ROUTER_VERSION=${MYSQL_ROUTER_VERSIONS["${MAJOR_VERSION}"]} 32 | fi 33 | MAJOR_VERSION=${ROUTER_VERSION%.*} 34 | podman run -d --rm -e MYSQL_HOST=x -e MYSQL_PORT=9 -e MYSQL_USER=x -e MYSQL_PASSWORD=x -e MYSQL_INNODB_CLUSTER_MEMBERS=1 --name "mysql-router-$MAJOR_VERSION" mysql/mysql-router:$MAJOR_VERSION-$ARCH sleep 5000 35 | export DOCKER_HOST=unix:///tmp/podman.sock 36 | podman system service --time=0 ${DOCKER_HOST} & DOCKER_SOCK_PID="$!" 37 | inspec exec $MAJOR_VERSION/inspec/control.rb --controls container 38 | inspec exec $MAJOR_VERSION/inspec/control.rb -t "docker://mysql-router-$MAJOR_VERSION" --controls packages 39 | podman stop -i "mysql-router-$MAJOR_VERSION" 40 | podman rm -i -f "mysql-router-$MAJOR_VERSION" 41 | kill -TERM ${DOCKER_SOCK_PID} 42 | rm -f /tmp/podman.sock 43 | done 44 | -------------------------------------------------------------------------------- /mysql-server/8.0/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.42 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.42 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ 23 | && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol9_appstream \ 29 | --enablerepo=mysql80-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf remove -y mysql-community-minimal-release mysql84-community-release \ 31 | && microdnf clean all \ 32 | && mkdir /docker-entrypoint-initdb.d 33 | 34 | COPY prepare-image.sh / 35 | RUN /prepare-image.sh && rm -f /prepare-image.sh 36 | 37 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 38 | 39 | COPY docker-entrypoint.sh /entrypoint.sh 40 | COPY healthcheck.sh /healthcheck.sh 41 | ENTRYPOINT ["/entrypoint.sh"] 42 | HEALTHCHECK CMD /healthcheck.sh 43 | EXPOSE 3306 33060 33061 44 | CMD ["mysqld"] 45 | 46 | -------------------------------------------------------------------------------- /mysql-server/8.0/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-server/8.0/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-server:8.0/ } 7 | its('names') { should include "mysql-server-8.0" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '8.0.42.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '8.0.42.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-server/8.0/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-server/8.1/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:8-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.1.0 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.1.0 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el8.rpm \ 23 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el8.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol8_appstream \ 29 | --enablerepo=mysql-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf remove mysql-community-minimal-release mysql80-community-release \ 31 | && microdnf clean all \ 32 | && mkdir /docker-entrypoint-initdb.d 33 | 34 | COPY prepare-image.sh / 35 | RUN /prepare-image.sh && rm -f /prepare-image.sh 36 | 37 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 38 | 39 | COPY docker-entrypoint.sh /entrypoint.sh 40 | COPY healthcheck.sh /healthcheck.sh 41 | ENTRYPOINT ["/entrypoint.sh"] 42 | HEALTHCHECK CMD /healthcheck.sh 43 | EXPOSE 3306 33060 33061 44 | CMD ["mysqld"] 45 | 46 | -------------------------------------------------------------------------------- /mysql-server/8.1/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-server/8.1/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-server:8.1/ } 7 | its('names') { should include "mysql-server-8.1" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '8.1.0.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '8.1.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-server/8.1/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-server/8.2/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:8-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.2.0 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.2.0 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el8.rpm \ 23 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el8.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol8_appstream \ 29 | --enablerepo=mysql-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf remove mysql-community-minimal-release mysql80-community-release \ 31 | && microdnf clean all \ 32 | && mkdir /docker-entrypoint-initdb.d 33 | 34 | COPY prepare-image.sh / 35 | RUN /prepare-image.sh && rm -f /prepare-image.sh 36 | 37 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 38 | 39 | COPY docker-entrypoint.sh /entrypoint.sh 40 | COPY healthcheck.sh /healthcheck.sh 41 | ENTRYPOINT ["/entrypoint.sh"] 42 | HEALTHCHECK CMD /healthcheck.sh 43 | EXPOSE 3306 33060 33061 44 | CMD ["mysqld"] 45 | 46 | -------------------------------------------------------------------------------- /mysql-server/8.2/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-server/8.2/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-server:8.2/ } 7 | its('names') { should include "mysql-server-8.2" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '8.2.0.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '8.2.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-server/8.2/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-server/8.3/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:8-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.3.0 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.3.0 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el8.rpm \ 23 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el8.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol8_appstream \ 29 | --enablerepo=mysql-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf remove mysql-community-minimal-release mysql80-community-release \ 31 | && microdnf clean all \ 32 | && mkdir /docker-entrypoint-initdb.d 33 | 34 | COPY prepare-image.sh / 35 | RUN /prepare-image.sh && rm -f /prepare-image.sh 36 | 37 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 38 | 39 | COPY docker-entrypoint.sh /entrypoint.sh 40 | COPY healthcheck.sh /healthcheck.sh 41 | ENTRYPOINT ["/entrypoint.sh"] 42 | HEALTHCHECK CMD /healthcheck.sh 43 | EXPOSE 3306 33060 33061 44 | CMD ["mysqld"] 45 | 46 | -------------------------------------------------------------------------------- /mysql-server/8.3/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-server/8.3/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-server:8.3/ } 7 | its('names') { should include "mysql-server-8.3" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '8.3.0.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '8.3.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-server/8.3/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-server/8.4/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.5 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.5 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ 23 | && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-8.4-lts-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol9_appstream \ 29 | --enablerepo=mysql-8.4-lts-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf remove -y mysql-community-minimal-release mysql84-community-release \ 31 | && microdnf clean all \ 32 | && mkdir /docker-entrypoint-initdb.d 33 | 34 | COPY prepare-image.sh / 35 | RUN /prepare-image.sh && rm -f /prepare-image.sh 36 | 37 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 38 | 39 | COPY docker-entrypoint.sh /entrypoint.sh 40 | COPY healthcheck.sh /healthcheck.sh 41 | ENTRYPOINT ["/entrypoint.sh"] 42 | HEALTHCHECK CMD /healthcheck.sh 43 | EXPOSE 3306 33060 33061 44 | CMD ["mysqld"] 45 | 46 | -------------------------------------------------------------------------------- /mysql-server/8.4/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-server/8.4/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-server:8.4/ } 7 | its('names') { should include "mysql-server-8.4" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '8.4.5.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '8.4.5.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-server/8.4/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-server/9.0/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-9.0.1 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.0.1 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ 23 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol9_appstream \ 29 | --enablerepo=mysql-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf remove -y mysql-community-minimal-release mysql84-community-release \ 31 | && microdnf clean all \ 32 | && mkdir /docker-entrypoint-initdb.d 33 | 34 | COPY prepare-image.sh / 35 | RUN /prepare-image.sh && rm -f /prepare-image.sh 36 | 37 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 38 | 39 | COPY docker-entrypoint.sh /entrypoint.sh 40 | COPY healthcheck.sh /healthcheck.sh 41 | ENTRYPOINT ["/entrypoint.sh"] 42 | HEALTHCHECK CMD /healthcheck.sh 43 | EXPOSE 3306 33060 33061 44 | CMD ["mysqld"] 45 | 46 | -------------------------------------------------------------------------------- /mysql-server/9.0/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-server/9.0/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-server:9.0/ } 7 | its('names') { should include "mysql-server-9.0" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '9.0.1.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '9.0.1.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-server/9.0/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-server/9.1/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-9.1.0 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.1.0 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ 23 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol9_appstream \ 29 | --enablerepo=mysql-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf remove -y mysql-community-minimal-release mysql84-community-release \ 31 | && microdnf clean all \ 32 | && mkdir /docker-entrypoint-initdb.d 33 | 34 | COPY prepare-image.sh / 35 | RUN /prepare-image.sh && rm -f /prepare-image.sh 36 | 37 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 38 | 39 | COPY docker-entrypoint.sh /entrypoint.sh 40 | COPY healthcheck.sh /healthcheck.sh 41 | ENTRYPOINT ["/entrypoint.sh"] 42 | HEALTHCHECK CMD /healthcheck.sh 43 | EXPOSE 3306 33060 33061 44 | CMD ["mysqld"] 45 | 46 | -------------------------------------------------------------------------------- /mysql-server/9.1/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-server/9.1/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-server:9.1/ } 7 | its('names') { should include "mysql-server-9.1" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '9.1.0.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '9.1.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-server/9.1/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-server/9.2/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-9.2.0 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.2.0 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ 23 | && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol9_appstream \ 29 | --enablerepo=mysql-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf remove -y mysql-community-minimal-release mysql84-community-release \ 31 | && microdnf clean all \ 32 | && mkdir /docker-entrypoint-initdb.d 33 | 34 | COPY prepare-image.sh / 35 | RUN /prepare-image.sh && rm -f /prepare-image.sh 36 | 37 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 38 | 39 | COPY docker-entrypoint.sh /entrypoint.sh 40 | COPY healthcheck.sh /healthcheck.sh 41 | ENTRYPOINT ["/entrypoint.sh"] 42 | HEALTHCHECK CMD /healthcheck.sh 43 | EXPOSE 3306 33060 33061 44 | CMD ["mysqld"] 45 | 46 | -------------------------------------------------------------------------------- /mysql-server/9.2/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-server/9.2/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-server:9.2/ } 7 | its('names') { should include "mysql-server-9.2" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '9.2.0.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '9.2.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-server/9.2/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-server/9.3/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-9.3.0 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.3.0 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \ 23 | && rpm -U https://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol9_appstream \ 29 | --enablerepo=mysql-innovation-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf remove -y mysql-community-minimal-release mysql84-community-release \ 31 | && microdnf clean all \ 32 | && mkdir /docker-entrypoint-initdb.d 33 | 34 | COPY prepare-image.sh / 35 | RUN /prepare-image.sh && rm -f /prepare-image.sh 36 | 37 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 38 | 39 | COPY docker-entrypoint.sh /entrypoint.sh 40 | COPY healthcheck.sh /healthcheck.sh 41 | ENTRYPOINT ["/entrypoint.sh"] 42 | HEALTHCHECK CMD /healthcheck.sh 43 | EXPOSE 3306 33060 33061 44 | CMD ["mysqld"] 45 | 46 | -------------------------------------------------------------------------------- /mysql-server/9.3/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-server/9.3/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-server:9.3/ } 7 | its('names') { should include "mysql-server-9.3" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match '9.3.0.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match '9.3.0.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-server/9.3/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-server/VERSION: -------------------------------------------------------------------------------- 1 | IMAGE_VERSION=1.2.21-server 2 | 3 | # LATEST is always set to the 4 | # current highest release, which is, 5 | # either 'innovation' or an LTS series 6 | # i.e. 9.7, or 10.7 7 | 8 | LATEST="innovation" 9 | 10 | 11 | 12 | # LATEST_LTS is set to the highest 13 | # LTS series currently being released 14 | # i.e. when 9.7 release will come it 15 | # will be set to 9.7 up till 10.7 and 16 | # then 10.7 and so on 17 | 18 | LATEST_LTS="8.4" 19 | 20 | 21 | 22 | # The value of key should be series 23 | # i.e. 8.0, 8.4, innovation, 9.7, etc. 24 | # do not use any other value for key 25 | # like 'latest-8.4' or 'lts-84', etc. 26 | 27 | declare -A MYSQL_SERVER_VERSIONS WEEKLY_SERVER_VERSIONS 28 | MYSQL_SERVER_VERSIONS["8.0"]=8.0.42 29 | MYSQL_SERVER_VERSIONS["8.4"]=8.4.5 30 | MYSQL_SERVER_VERSIONS["innovation"]=9.3.0 31 | 32 | WEEKLY_SERVER_VERSIONS["8.0"]=8.0.43 33 | WEEKLY_SERVER_VERSIONS["8.4"]=8.4.6 34 | WEEKLY_SERVER_VERSIONS["innovation"]=9.4.0 35 | 36 | declare -A MYSQL_SHELL_VERSIONS WEEKLY_SHELL_VERSIONS 37 | MYSQL_SHELL_VERSIONS["8.0"]=8.0.42 38 | MYSQL_SHELL_VERSIONS["8.4"]=8.4.5 39 | MYSQL_SHELL_VERSIONS["innovation"]=9.3.0 40 | 41 | WEEKLY_SHELL_VERSIONS["8.0"]=8.0.43 42 | WEEKLY_SHELL_VERSIONS["8.4"]=8.4.6 43 | WEEKLY_SHELL_VERSIONS["innovation"]=9.4.0 44 | -------------------------------------------------------------------------------- /mysql-server/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2018, 2023 Oracle and/or its affiliates. All rights reserved. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | set -e 17 | source ./VERSION 18 | 19 | if grep -q Microsoft /proc/version; then 20 | echo "Running on Windows Subsystem for Linux" 21 | # WSL doesn't have its own docker host, we have to use the one 22 | # from Windows itself. 23 | # https://medium.com/@sebagomez/installing-the-docker-client-on-ubuntus-windows-subsystem-for-linux-612b392a44c4 24 | export DOCKER_HOST=localhost:2375 25 | fi 26 | 27 | ARCH=amd64; [ -n "$1" ] && ARCH=$1 28 | BUILD_TYPE=community; [ -n "$2" ] && BUILD_TYPE=$2 29 | MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$3" ] && MAJOR_VERSIONS=("${@:3}") 30 | 31 | if [[ ${BUILD_TYPE} =~ (commercial) ]]; then 32 | IMG_LOC=store/oracle/mysql-enterprise-server 33 | else 34 | IMG_LOC=mysql/mysql-server 35 | fi 36 | 37 | for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do 38 | if [[ "$BUILD_TYPE" =~ (weekly) ]]; then 39 | SERVER_VERSION=${WEEKLY_SERVER_VERSIONS["${MAJOR_VERSION}"]} 40 | else 41 | SERVER_VERSION=${MYSQL_SERVER_VERSIONS["${MAJOR_VERSION}"]} 42 | fi 43 | MAJOR_VERSION=${SERVER_VERSION%.*} 44 | docker build --build-arg http_proxy="$http_proxy" --build-arg https_proxy="$http_proxy" --build-arg no_proxy="$no_proxy" -t $IMG_LOC:"$MAJOR_VERSION"-$ARCH "$MAJOR_VERSION" 45 | done 46 | -------------------------------------------------------------------------------- /mysql-server/changelog: -------------------------------------------------------------------------------- 1 | Changes in 1.2.0 (2021-01-15) 2 | * Removed EOLed 5.5 and 5.6 3 | * Upgraded base image to el8-slim, switched from yum to microdnf 4 | * Generate password internally in entryfile, removed pwmake 5 | * Support for running in a container as non-root/mysql user 6 | * Write MySQL files in /var/lib/mysql instead of / 7 | * Always log to stderr 8 | * Added MYSQL_INITIALIZE_ONLY option 9 | 10 | Changes in 1.1.5 (2018-04-19) 11 | * Bumped server versions to 5.5.60, 5.6.40, 5.7.22 12 | * MySQL Server 8.0 updated to 8.0.11 13 | * Bumped Shell 8.0 version to 8.0.11 14 | 15 | Changes in 1.1.4 (2018-01-24) 16 | * MySQL Server 8.0 updated to 8.0.4-rc 17 | 18 | Changes in 1.1.3 (2018-01-15) 19 | * Bumped server versions to 5.5.59, 5.6.39, 5.7.21 20 | * Bumped Shell 1.0 version to 1.0.11 21 | 22 | Changes in 1.1.2 (2017-10-16) 23 | * Bumped server versions to 5.5.58, 5.6.38, 5.7.20 24 | * Bumped Shell 8.0 version to 8.0.3 25 | 26 | Changes in 1.1.1 (2017-09-22) 27 | * Disable binlog for all entrypoint client commands (#87305) 28 | This was previously only done only for the script to set the root password, 29 | but should be done for all client commands, or group replication will fail 30 | * Add flag for logging to console (#87458) 31 | Setting -e MYSQL_LOG_CONSOLE=true will make the server log to console, so the 32 | server log is available through Docker's log interface. If /etc/my.cnf is 33 | mounted from the host system, this has no effect. On 8.0, this is the default 34 | behavior. 35 | * Ensure both MYSQL_USER and MYSQL_PASSWORD are set (#86982) 36 | Before, setting only one would cause the option to be silently ignored. 37 | * Read password file first and throw error if it is empty (#87025) 38 | Setting MYSQL_ROOT_PASSWORD to an empty string would be rejected, but 39 | setting it to a file with no content would be accepted. Both are now rejected. 40 | * MYSQL_RANDOM_ROOT_PASSWORD and MYSQL_ONETIME_PASSWORD are now set by default. (#87515) 41 | A password option no longer needs to be set explicitly. If none are set, a 42 | random, expired password is set. 43 | * Make root@$MYSQL_ROOT_HOST identical to root@localhost (#86945) 44 | If the MYSQL_ROOT_HOST variable is set we add an additional root user for 45 | the given host. This user was missing the PROXY privilege. We add the 46 | missing privilege so the users are identical. 47 | * MySQL Server 8.0 updated to 8.0.3-rc 48 | * MySQL Shell for 5.7 updated to 1.0.10 49 | 50 | Changes in 1.1.0 (2017-07-24) 51 | * Fixed broken MYSQL_ONETIME_PASSWORD support (#86523) 52 | The functionality wasn't correctly updated when the entrypoint script was 53 | changed to only create the root@localhost user by default 54 | * Changed control files to be generated from a common template 55 | The control files for each version will be generated by swapping out the few 56 | commands that differ between server versions 57 | * Made PACKAGE_URL an ARG entry, to allow build-time changing 58 | The URL variables can be changed by supplying new ones with --build-arg at 59 | build time 60 | * Added basic healthcheck script 61 | Once database init is complete a flag file will be touched. If this file 62 | exists and mysqladmin ping succeeds, the container is reported as healthy, 63 | meaning it is ready for use 64 | * Database init will now use configured socket setting instead of hardcoded 65 | Using a hardcoded socket could cause init scripts to fail in confusing ways 66 | if the user customized the socket setting 67 | * Added MySQL Shell to supported images 68 | For 5.7 and 8.0, MySQL Shell is installed together with the server. 69 | https://dev.mysql.com/doc/refman/5.7/en/mysql-shell.html 70 | 71 | Known issues: 72 | * For existing databases created with older images/not with Docker, the 73 | healthcheck script will generate an "Access denied for healthchecker@localhost" 74 | message in the server log every time it runs. If connection throttling is 75 | enabled this could eventually cause the healthcheck to fail 76 | -------------------------------------------------------------------------------- /mysql-server/manifest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | set -e 17 | source ./VERSION 18 | 19 | if grep -q Microsoft /proc/version; then 20 | echo "Running on Windows Subsystem for Linux" 21 | # WSL doesn't have its own docker host, we have to use the one 22 | # from Windows itself. 23 | # https://medium.com/@sebagomez/installing-the-docker-client-on-ubuntus-windows-subsystem-for-linux-612b392a44c4 24 | export DOCKER_HOST=localhost:2375 25 | fi 26 | 27 | REPO=mysql/mysql-server; [ -n "$1" ] && REPO=$1 28 | MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}") 29 | 30 | WEEKLY=0 31 | if [[ "$REPO" =~ (weekly) ]]; then 32 | WEEKLY=1 33 | fi 34 | 35 | MANIFEST_VERSIONS=$(./tag.sh "" "$WEEKLY" "${MAJOR_VERSIONS[@]}") 36 | echo ${MANIFEST_VERSIONS} 37 | for MANIFEST_VERSION in $MANIFEST_VERSIONS; do 38 | docker pull "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" 39 | docker manifest create "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" "$REPO:$MANIFEST_VERSION-amd64" 40 | docker manifest add "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-arm64" --os linux --arch arm64 41 | docker manifest add "$REPO:$MANIFEST_VERSION" "$REPO:$MANIFEST_VERSION-amd64" --os linux --arch amd64 42 | docker manifest push "$REPO:$MANIFEST_VERSION" "docker://$REPO:$MANIFEST_VERSION" 43 | done 44 | -------------------------------------------------------------------------------- /mysql-server/mysql-community-minimal-release/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:8-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-mysql-community-minimal-release 19 | ARG MYSQL_SHELL_PACKAGE=mysql-shell-mysql80-community-release 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el8.rpm \ 23 | && rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql80-community-release-el8.rpm 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=mysql-tools-community $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol8_appstream \ 29 | --enablerepo=mysql5-community-minimal $MYSQL_SERVER_PACKAGE \ 30 | && microdnf remove mysql-community-minimal-release mysql80-community-release \ 31 | && microdnf clean all \ 32 | && mkdir /docker-entrypoint-initdb.d 33 | 34 | COPY prepare-image.sh / 35 | RUN /prepare-image.sh && rm -f /prepare-image.sh 36 | 37 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 38 | 39 | COPY docker-entrypoint.sh /entrypoint.sh 40 | COPY healthcheck.sh /healthcheck.sh 41 | ENTRYPOINT ["/entrypoint.sh"] 42 | HEALTHCHECK CMD /healthcheck.sh 43 | EXPOSE 3306 33060 33061 44 | CMD ["mysqld"] 45 | 46 | -------------------------------------------------------------------------------- /mysql-server/mysql-community-minimal-release/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-server/mysql-community-minimal-release/inspec/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /mysql-server:mysql-community-minimal-release/ } 7 | its('names') { should include "mysql-server-mysql-community-minimal-release" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('mysql-community-server-minimal') do 13 | it { should be_installed } 14 | its ('version') { should match 'mysql-community-minimal-release.*' } 15 | end 16 | describe package('mysql-shell') do 17 | it { should be_installed } 18 | its ('version') { should match 'mysql80-community-release.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-server/mysql-community-minimal-release/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-server/tag.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | set -e 17 | source VERSION 18 | 19 | SUFFIX='' [ -n "$1" ] && SUFFIX=$1 20 | WEEKLY='' [ -n "$2" ] && WEEKLY=$2 21 | MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$3" ] && MAJOR_VERSIONS=("${@:3}") 22 | 23 | for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do 24 | if [ "$WEEKLY" == "1" ]; then 25 | SERVER_VERSION=${WEEKLY_SERVER_VERSIONS["${MAJOR_VERSION}"]} 26 | else 27 | SERVER_VERSION=${MYSQL_SERVER_VERSIONS["${MAJOR_VERSION}"]} 28 | fi 29 | MAJOR_VERSION=${SERVER_VERSION%.*} 30 | FULL_SERVER_VERSION="${SERVER_VERSION}-${IMAGE_VERSION}" 31 | TAGS="${MAJOR_VERSION}${SUFFIX} ${SERVER_VERSION}${SUFFIX} ${FULL_SERVER_VERSION}${SUFFIX}" 32 | if [[ "$MAJOR_VERSION" == "$LATEST" ]]; then 33 | TAGS="$TAGS latest${SUFFIX}" 34 | fi 35 | echo $TAGS 36 | done 37 | -------------------------------------------------------------------------------- /mysql-server/template/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, 2023, Oracle and/or its affiliates. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | FROM container-registry.oracle.com/os/oraclelinux:9-slim 17 | 18 | ARG MYSQL_SERVER_PACKAGE=%%MYSQL_SERVER_PACKAGE%% 19 | ARG MYSQL_SHELL_PACKAGE=%%MYSQL_SHELL_PACKAGE%% 20 | 21 | # Setup repositories for minimal packages (all versions) 22 | RUN rpm -U %%REPO%%/%%CONFIG_PACKAGE_NAME_MINIMAL%% \ 23 | && rpm -U %%REPO%%/%%CONFIG_PACKAGE_NAME%% 24 | 25 | # Install server and shell 8.0 26 | RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \ 27 | && microdnf install -y --enablerepo=%%REPO_NAME_TOOLS%% $MYSQL_SHELL_PACKAGE \ 28 | && microdnf install -y --disablerepo=ol9_appstream \ 29 | --enablerepo=%%REPO_NAME_SERVER%% $MYSQL_SERVER_PACKAGE \ 30 | && microdnf remove -y %%MYSQL_CONFIG_PKG_MINIMAL%% %%MYSQL_CONFIG_PKG%% \ 31 | && microdnf clean all \ 32 | && mkdir /docker-entrypoint-initdb.d 33 | 34 | COPY prepare-image.sh / 35 | RUN /prepare-image.sh && rm -f /prepare-image.sh 36 | 37 | ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock 38 | 39 | COPY docker-entrypoint.sh /entrypoint.sh 40 | COPY healthcheck.sh /healthcheck.sh 41 | ENTRYPOINT ["/entrypoint.sh"] 42 | HEALTHCHECK CMD /healthcheck.sh 43 | EXPOSE %%PORTS%% 44 | CMD ["mysqld"] 45 | 46 | -------------------------------------------------------------------------------- /mysql-server/template/control.rb: -------------------------------------------------------------------------------- 1 | control 'container' do 2 | impact 0.5 3 | describe podman.containers do 4 | its('status') { should cmp /Up/ } 5 | its('commands') { should cmp /mysqld/ } 6 | its('images') { should cmp /%%CONT_NAME%%:%%MAJOR_VERSION%%/ } 7 | its('names') { should include "%%CONT_NAME%%-%%MAJOR_VERSION%%" } 8 | end 9 | end 10 | control 'packages' do 11 | impact 0.5 12 | describe package('%%MYSQL_SERVER_PACKAGE_NAME%%') do 13 | it { should be_installed } 14 | its ('version') { should match '%%MYSQL_SERVER_VERSION%%.*' } 15 | end 16 | describe package('%%MYSQL_SHELL_PACKAGE_NAME%%') do 17 | it { should be_installed } 18 | its ('version') { should match '%%MYSQL_SHELL_VERSION%%.*' } 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /mysql-server/template/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017, 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # The mysql-init-complete file is touched by the entrypoint file before the 18 | # main server process is started 19 | if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file 20 | then # Ping server to see if it is ready 21 | mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping 22 | else # Initialization still in progress 23 | exit 1 24 | fi 25 | -------------------------------------------------------------------------------- /mysql-server/template/prepare-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2021, Oracle and/or its affiliates. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | 18 | # Create directories needed by mysqld and make them writable by group 0 19 | mysql_dirs="/var/lib/mysql /var/lib/mysql-files /var/lib/mysql-keyring /var/run/mysqld" 20 | 21 | for dir in $mysql_dirs; do 22 | mkdir -p $dir 23 | chmod g+rwx $dir 24 | chgrp -R 0 $dir 25 | done 26 | -------------------------------------------------------------------------------- /mysql-server/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; version 2 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # This script will simply use sed to replace placeholder variables in the 18 | # files in template/ with version-specific variants. 19 | set -e 20 | source ./VERSION 21 | 22 | if grep -q Microsoft /proc/version; then 23 | echo "Running on Windows Subsystem for Linux" 24 | # WSL doesn't have its own docker host, we have to use the one 25 | # from Windows itself. 26 | # https://medium.com/@sebagomez/installing-the-docker-client-on-ubuntus-windows-subsystem-for-linux-612b392a44c4 27 | export DOCKER_HOST=localhost:2375 28 | shopt -s expand_aliases 29 | alias inspec="cmd.exe /c C:/opscode/inspec/bin/inspec" 30 | fi 31 | 32 | ARCH=amd64; [ -n "$1" ] && ARCH=$1 33 | BUILD_TYPE=community; [ -n "$2" ] && BUILD_TYPE=$2 34 | MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$3" ] && MAJOR_VERSIONS=("${@:3}") 35 | 36 | for MAJOR_VERSION in "${MAJOR_VERSIONS[@]}"; do 37 | if [[ "$BUILD_TYPE" =~ (weekly) ]]; then 38 | SERVER_VERSION=${WEEKLY_SERVER_VERSIONS["${MAJOR_VERSION}"]} 39 | else 40 | SERVER_VERSION=${MYSQL_SERVER_VERSIONS["${MAJOR_VERSION}"]} 41 | fi 42 | MAJOR_VERSION=${SERVER_VERSION%.*} 43 | if [[ ${BUILD_TYPE} =~ (commercial) ]]; then 44 | IMG_LOC="store/oracle/mysql-enterprise-server" 45 | CONT_NAME="mysql-enterprise-server-$MAJOR_VERSION" 46 | else 47 | IMG_LOC="mysql/mysql-server" 48 | CONT_NAME="mysql-server-$MAJOR_VERSION" 49 | fi 50 | 51 | ARCH_SUFFIX="-$ARCH" 52 | podman run -d --rm --name $CONT_NAME "$IMG_LOC":"$MAJOR_VERSION$ARCH_SUFFIX" 53 | export DOCKER_HOST=unix:///tmp/podman.sock 54 | podman system service --time=0 ${DOCKER_HOST} & DOCKER_SOCK_PID="$!" 55 | inspec exec --no-color "$MAJOR_VERSION/inspec/control.rb" --controls container 56 | inspec exec --no-color "$MAJOR_VERSION/inspec/control.rb" -t "docker://$CONT_NAME" --controls packages 57 | podman stop -i "$CONT_NAME" 58 | podman rm -i -f "$CONT_NAME" 59 | kill -TERM ${DOCKER_SOCK_PID} 60 | rm -f /tmp/podman.sock 61 | done 62 | --------------------------------------------------------------------------------