├── .github ├── auto-merge.yml ├── dependabot.yml └── workflows │ ├── auto-merge-on-demand.yml │ ├── auto-merge.yml │ ├── build-and-push.yml │ ├── container-tests.yml │ ├── openshift-pytests.yml │ ├── openshift-tests.yml │ └── pr-metadata.yml ├── .gitignore ├── .gitmodules ├── 10.11 ├── .exclude-c8s ├── Dockerfile.c10s ├── Dockerfile.c8s ├── Dockerfile.c9s ├── Dockerfile.fedora ├── Dockerfile.rhel10 ├── Dockerfile.rhel8 ├── Dockerfile.rhel9 ├── README.md ├── root-common ├── root │ └── usr │ │ └── share │ │ └── container-scripts │ │ └── mysql │ │ └── README.md ├── s2i-common └── test ├── 10.3 ├── .exclude-c8s ├── .exclude-centos7 ├── .exclude-fedora ├── .exclude-rhel7 ├── Dockerfile ├── Dockerfile.c8s ├── Dockerfile.fedora ├── Dockerfile.rhel7 ├── Dockerfile.rhel8 ├── README.md ├── root-common ├── root │ └── usr │ │ └── share │ │ └── container-scripts │ │ └── mysql │ │ └── README.md ├── s2i-common └── test ├── 10.5 ├── .exclude-c8s ├── .exclude-centos7 ├── .exclude-fedora ├── .exclude-rhel7 ├── Dockerfile ├── Dockerfile.c8s ├── Dockerfile.c9s ├── Dockerfile.fedora ├── Dockerfile.rhel7 ├── Dockerfile.rhel8 ├── Dockerfile.rhel9 ├── README.md ├── root-common ├── root │ └── usr │ │ └── share │ │ └── container-scripts │ │ └── mysql │ │ └── README.md ├── s2i-common └── test ├── LICENSE ├── Makefile ├── README.md ├── examples ├── extend-image │ ├── mysql-cfg │ │ └── myconfig.cnf │ ├── mysql-data │ │ └── init.sql │ ├── mysql-init │ │ ├── 80-add-arbitrary-users.sh │ │ └── 90-init-db.sh │ └── mysql-pre-init │ │ └── 80-check-arbitrary-users.sh ├── mariadb-ephemeral-template.json ├── mariadb-persistent-template.json └── self-signed-ssl │ ├── mysql-certs │ ├── server-cert-selfsigned.pem │ └── server-key.pem │ └── mysql-cfg │ └── ssl.cnf ├── imagestreams ├── imagestreams.yaml ├── mariadb-centos.json ├── mariadb-rhel-aarch64.json └── mariadb-rhel.json ├── root-common ├── etc │ └── my.cnf └── usr │ ├── bin │ ├── container-entrypoint │ ├── mysqld-master │ ├── mysqld-slave │ ├── run-mysqld │ ├── run-mysqld-master │ ├── run-mysqld-slave │ └── usage │ ├── libexec │ ├── container-setup │ └── fix-permissions │ └── share │ └── container-scripts │ └── mysql │ ├── cnf │ ├── 40-paas.cnf │ └── 50-my-tuning.cnf │ ├── common.sh │ ├── helpers.sh │ ├── init │ ├── 40-datadir-action.sh │ └── 50-passwd-change.sh │ ├── post-init.sh │ ├── pre-init │ ├── 20-validate-variables.sh │ ├── 25-validate-replication-variables.sh │ ├── 30-base-config.sh │ ├── 60-replication-config.sh │ ├── 70-s2i-config.sh │ ├── my-base.cnf.template │ ├── my-master.cnf.template │ ├── my-repl-gtid.cnf.template │ └── my-slave.cnf.template │ └── scl_enable ├── s2i-common └── bin │ ├── assemble │ └── usage └── test ├── __init__.py ├── check_imagestreams.py ├── constants.py ├── examples ├── imagestreams ├── mariadb-ephemeral-template.json ├── mariadb-persistent-template.json ├── run ├── run-openshift-pytest ├── run-openshift-remote-cluster ├── show_all_imagestreams.py ├── test-app ├── test-lib-mysql.sh ├── test-lib-openshift.sh ├── test-lib-remote-openshift.sh ├── test-lib.sh ├── test-openshift.yaml ├── test_mariadb_imagestream.py ├── test_mariadb_imagestream_template.py ├── test_mariadb_latest_imagestreams.py ├── test_mariadb_local_template.py ├── test_mariadb_shared_helm_imagestreams.py └── test_mariadb_shared_helm_template.py /.github/auto-merge.yml: -------------------------------------------------------------------------------- 1 | target-branch: [] 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | version: 2 4 | updates: 5 | - package-ecosystem: gitsubmodule 6 | directory: / 7 | schedule: 8 | interval: weekly 9 | labels: 10 | - 'ready for review' 11 | - package-ecosystem: github-actions 12 | directory: / 13 | schedule: 14 | interval: monthly 15 | labels: 16 | - 'ready for review' 17 | -------------------------------------------------------------------------------- /.github/workflows/auto-merge-on-demand.yml: -------------------------------------------------------------------------------- 1 | name: Auto Merge On Demand 2 | on: 3 | issue_comment: 4 | types: 5 | - created 6 | workflow_dispatch: 7 | inputs: 8 | pr-number: 9 | description: 'Pull Request number/s ; when not provided, the workflow will run for all open PRs' 10 | required: true 11 | default: '0' 12 | 13 | permissions: 14 | contents: read 15 | 16 | jobs: 17 | # Get all open PRs 18 | gather-pull-requests: 19 | if: | 20 | github.repository_owner == 'sclorg' 21 | || (contains(github.event.comment.body, '/auto-merge') 22 | && contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association)) 23 | runs-on: ubuntu-latest 24 | 25 | outputs: 26 | pr-numbers: ${{ steps.get-pr-numbers.outputs.result }} 27 | pr-numbers-manual: ${{ steps.parse-manual-input.outputs.result }} 28 | 29 | steps: 30 | - id: get-pr-numbers 31 | if: inputs.pr-number == '0' 32 | name: Get all open PRs 33 | uses: actions/github-script@v7 34 | with: 35 | # !FIXME: this is not working if there is more than 100 PRs opened 36 | script: | 37 | const { data: pullRequests } = await github.rest.pulls.list({ 38 | owner: context.repo.owner, 39 | repo: context.repo.repo, 40 | state: 'open', 41 | per_page: 100 42 | }); 43 | return pullRequests.map(pr => pr.number); 44 | 45 | - id: parse-manual-input 46 | if: inputs.pr-number != '0' 47 | name: Parse manual input 48 | run: | 49 | # shellcheck disable=SC2086 50 | echo "result="[ ${{ github.event.issue.number }} ]"" >> $GITHUB_OUTPUT 51 | shell: bash 52 | 53 | validate-pr: 54 | name: 'Validation of Pull Request #${{ matrix.pr-number }}' 55 | needs: [ gather-pull-requests ] 56 | runs-on: ubuntu-latest 57 | 58 | strategy: 59 | fail-fast: false 60 | matrix: 61 | pr-number: ${{ inputs.pr-number == 0 && fromJSON(needs.gather-pull-requests.outputs.pr-numbers) || fromJSON(needs.gather-pull-requests.outputs.pr-numbers-manual) }} 62 | 63 | permissions: 64 | # required for merging PRs 65 | contents: write 66 | # required for PR comments and setting labels 67 | pull-requests: write 68 | 69 | steps: 70 | - name: Auto Merge wrapper 71 | uses: sclorg/auto-merge-wrapper@v1 72 | with: 73 | pr-number: ${{ matrix.pr-number }} 74 | token: ${{ secrets.GITHUB_TOKEN }} 75 | -------------------------------------------------------------------------------- /.github/workflows/auto-merge.yml: -------------------------------------------------------------------------------- 1 | name: Auto Merge 2 | on: 3 | workflow_run: 4 | workflows: [ Gather Pull Request Metadata ] 5 | types: 6 | - completed 7 | 8 | permissions: 9 | contents: read 10 | 11 | jobs: 12 | download-metadata: 13 | if: > 14 | github.event.workflow_run.event == 'pull_request' && 15 | github.event.workflow_run.conclusion == 'success' 16 | runs-on: ubuntu-latest 17 | 18 | outputs: 19 | pr-metadata: ${{ steps.Artifact.outputs.pr-metadata-json }} 20 | 21 | steps: 22 | - id: Artifact 23 | name: Download Artifact 24 | uses: redhat-plumbers-in-action/download-artifact@v1 25 | with: 26 | name: pr-metadata 27 | 28 | auto-merge: 29 | needs: [ download-metadata ] 30 | runs-on: ubuntu-latest 31 | 32 | permissions: 33 | # required for merging PRs 34 | contents: write 35 | # required for PR comments and setting labels 36 | pull-requests: write 37 | 38 | steps: 39 | - name: Auto Merge wrapper 40 | uses: sclorg/auto-merge-wrapper@v1 41 | with: 42 | pr-metadata: ${{ needs.download-metadata.outputs.pr-metadata }} 43 | token: ${{ secrets.GITHUB_TOKEN }} 44 | -------------------------------------------------------------------------------- /.github/workflows/build-and-push.yml: -------------------------------------------------------------------------------- 1 | name: Build and push images to Quay.io registry 2 | on: 3 | push: 4 | branches: 5 | - master 6 | schedule: 7 | - cron: '0 1 * * 3' 8 | 9 | jobs: 10 | build-and-push: 11 | if: github.repository_owner == 'sclorg' 12 | runs-on: ubuntu-latest 13 | strategy: 14 | fail-fast: false 15 | matrix: 16 | include: 17 | - dockerfile: "10.11/Dockerfile.c9s" 18 | docker_context: "10.11" 19 | registry_namespace: "sclorg" 20 | quayio_username: "QUAY_IMAGE_SCLORG_BUILDER_USERNAME" 21 | quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN" 22 | tag: "c9s" 23 | image_name: "mariadb-1011-c9s" 24 | 25 | - dockerfile: "10.11/Dockerfile.c10s" 26 | docker_context: "10.11" 27 | registry_namespace: "sclorg" 28 | quayio_username: "QUAY_IMAGE_SCLORG_BUILDER_USERNAME" 29 | quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN" 30 | tag: "c10s" 31 | image_name: "mariadb-1011-c10s" 32 | 33 | - dockerfile: "10.5/Dockerfile.c9s" 34 | docker_context: "10.5" 35 | registry_namespace: "sclorg" 36 | quayio_username: "QUAY_IMAGE_SCLORG_BUILDER_USERNAME" 37 | quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN" 38 | tag: "c9s" 39 | image_name: "mariadb-105-c9s" 40 | 41 | - dockerfile: "10.5/Dockerfile.fedora" 42 | docker_context: "10.5" 43 | registry_namespace: "fedora" 44 | quayio_username: "QUAY_IMAGE_FEDORA_BUILDER_USERNAME" 45 | quayio_token: "QUAY_IMAGE_FEDORA_BUILDER_TOKEN" 46 | tag: "fedora" 47 | image_name: "mariadb-105" 48 | 49 | - dockerfile: "10.11/Dockerfile.fedora" 50 | docker_context: "10.11" 51 | registry_namespace: "fedora" 52 | quayio_username: "QUAY_IMAGE_FEDORA_BUILDER_USERNAME" 53 | quayio_token: "QUAY_IMAGE_FEDORA_BUILDER_TOKEN" 54 | tag: "fedora" 55 | image_name: "mariadb-1011" 56 | 57 | steps: 58 | - name: Build and push to quay.io registry 59 | uses: sclorg/build-and-push-action@v4 60 | with: 61 | registry: "quay.io" 62 | registry_namespace: ${{ matrix.registry_namespace }} 63 | registry_username: ${{ secrets[matrix.quayio_username] }} 64 | registry_token: ${{ secrets[matrix.quayio_token] }} 65 | dockerfile: ${{ matrix.dockerfile }} 66 | tag: ${{ matrix.tag }} 67 | image_name: ${{ matrix.image_name }} 68 | readme: "${{ matrix.docker_context }}/README.md" 69 | quay_application_token: ${{ secrets.QUAY_IMAGE_SCLORG_UPDATE_DESC }} 70 | -------------------------------------------------------------------------------- /.github/workflows/container-tests.yml: -------------------------------------------------------------------------------- 1 | on: 2 | issue_comment: 3 | types: 4 | - created 5 | jobs: 6 | container-tests: 7 | # This job only runs for '[test]' pull request comments by owner, member 8 | name: "Container tests: ${{ matrix.version }} - ${{ matrix.os_test }}" 9 | runs-on: ubuntu-latest 10 | concurrency: 11 | group: container-${{ github.event.issue.number }}-${{ matrix.version }}-${{ matrix.os_test }} 12 | cancel-in-progress: true 13 | strategy: 14 | fail-fast: false 15 | matrix: 16 | version: [ "10.3", "10.5", "10.11" ] 17 | os_test: [ "fedora", "rhel8", "rhel9", "c9s", "c10s", "rhel10" ] 18 | test_case: [ "container" ] 19 | 20 | if: | 21 | github.event.issue.pull_request 22 | && (contains(github.event.comment.body, '[test]') || contains(github.event.comment.body, '[test-all]')) 23 | && contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association) 24 | steps: 25 | - uses: sclorg/tfaga-wrapper@main 26 | with: 27 | os_test: ${{ matrix.os_test }} 28 | version: ${{ matrix.version }} 29 | test_case: ${{ matrix.test_case }} 30 | public_api_key: ${{ secrets.TF_PUBLIC_API_KEY }} 31 | private_api_key: ${{ secrets.TF_INTERNAL_API_KEY }} 32 | -------------------------------------------------------------------------------- /.github/workflows/openshift-pytests.yml: -------------------------------------------------------------------------------- 1 | on: 2 | issue_comment: 3 | types: 4 | - created 5 | jobs: 6 | check-imagestreams: 7 | runs-on: ubuntu-latest 8 | permissions: 9 | contents: read 10 | statuses: write 11 | if: | 12 | github.event.issue.pull_request 13 | && (contains(github.event.comment.body, '[test-openshift-pytest]') || contains(github.event.comment.body, '[test-all]')) 14 | && contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association) 15 | steps: 16 | - uses: sclorg/ci-scripts/ocp-stream-generator@master 17 | with: 18 | ref: "refs/pull/${{ github.event.issue.number }}/head" 19 | 20 | openshift-pytests: 21 | name: "${{ matrix.test_case }} PyTests: ${{ matrix.version }} - ${{ matrix.os_test }}" 22 | runs-on: ubuntu-latest 23 | needs: check-imagestreams 24 | concurrency: 25 | group: ocp-pytest-${{ github.event.issue.number }}-${{ matrix.version }}-${{ matrix.os_test }} 26 | cancel-in-progress: true 27 | strategy: 28 | fail-fast: false 29 | matrix: 30 | version: [ "10.3", "10.5", "10.11" ] 31 | os_test: [ "rhel8", "rhel9", "rhel10" ] 32 | test_case: [ "openshift-pytest" ] 33 | 34 | steps: 35 | - uses: sclorg/tfaga-wrapper@main 36 | with: 37 | os_test: ${{ matrix.os_test }} 38 | version: ${{ matrix.version }} 39 | test_case: ${{ matrix.test_case }} 40 | public_api_key: ${{ secrets.TF_PUBLIC_API_KEY }} 41 | private_api_key: ${{ secrets.TF_INTERNAL_API_KEY }} 42 | -------------------------------------------------------------------------------- /.github/workflows/openshift-tests.yml: -------------------------------------------------------------------------------- 1 | on: 2 | issue_comment: 3 | types: 4 | - created 5 | jobs: 6 | check-imagestreams: 7 | runs-on: ubuntu-latest 8 | permissions: 9 | contents: read 10 | statuses: write 11 | if: | 12 | github.event.issue.pull_request 13 | && (contains(github.event.comment.body, '[test-openshift]') || contains(github.event.comment.body, '[test-all]')) 14 | && contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association) 15 | steps: 16 | - uses: sclorg/ci-scripts/ocp-stream-generator@master 17 | with: 18 | ref: "refs/pull/${{ github.event.issue.number }}/head" 19 | 20 | openshift-tests: 21 | name: "${{ matrix.test_case }} tests: ${{ matrix.version }} - ${{ matrix.os_test }}" 22 | runs-on: ubuntu-latest 23 | needs: check-imagestreams 24 | concurrency: 25 | group: ocp-${{ github.event.issue.number }}-${{ matrix.version }}-${{ matrix.os_test }} 26 | cancel-in-progress: true 27 | strategy: 28 | fail-fast: false 29 | matrix: 30 | version: [ "10.3", "10.5", "10.11" ] 31 | os_test: [ "rhel8", "rhel9", "rhel10" ] 32 | test_case: [ "openshift-4" ] 33 | 34 | steps: 35 | - uses: sclorg/tfaga-wrapper@main 36 | with: 37 | os_test: ${{ matrix.os_test }} 38 | version: ${{ matrix.version }} 39 | test_case: ${{ matrix.test_case }} 40 | public_api_key: ${{ secrets.TF_PUBLIC_API_KEY }} 41 | private_api_key: ${{ secrets.TF_INTERNAL_API_KEY }} 42 | -------------------------------------------------------------------------------- /.github/workflows/pr-metadata.yml: -------------------------------------------------------------------------------- 1 | name: Gather Pull Request Metadata 2 | on: 3 | pull_request: 4 | types: [ opened, reopened, synchronize ] 5 | branches: [ master ] 6 | 7 | permissions: 8 | contents: read 9 | 10 | jobs: 11 | gather-metadata: 12 | if: github.repository_owner == 'sclorg' 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - name: Repository checkout 17 | uses: actions/checkout@v4 18 | 19 | - id: Metadata 20 | name: Gather Pull Request Metadata 21 | uses: redhat-plumbers-in-action/gather-pull-request-metadata@v1 22 | 23 | - name: Upload artifact with gathered metadata 24 | uses: actions/upload-artifact@v4 25 | with: 26 | name: pr-metadata 27 | path: ${{ steps.Metadata.outputs.metadata-file }} 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .*image-id* 2 | help.1 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "common"] 2 | path = common 3 | url = https://github.com/sclorg/container-common-scripts.git 4 | -------------------------------------------------------------------------------- /10.11/.exclude-c8s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/mariadb-container/6529b302e016a82afcb4e1c4cbae4d61824e4c78/10.11/.exclude-c8s -------------------------------------------------------------------------------- /10.11/Dockerfile.c10s: -------------------------------------------------------------------------------- 1 | FROM quay.io/sclorg/s2i-core-c10s:c10s 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | 13 | # Standalone ENV call so these values can be re-used in the other ENV calls 14 | ENV MYSQL_VERSION=10.11 \ 15 | MYSQL_SHORT_VERSION=1011 16 | 17 | ENV VERSION="${MYSQL_VERSION}" \ 18 | APP_DATA=/opt/app-root/src \ 19 | HOME=/var/lib/mysql \ 20 | NAME=mariadb \ 21 | ARCH=x86_64 \ 22 | SUMMARY="MariaDB ${MYSQL_VERSION} SQL database server" \ 23 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 24 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 25 | The mysqld server daemon accepts connections from clients and provides access to content from \ 26 | MariaDB databases on behalf of the clients." 27 | 28 | LABEL summary="${SUMMARY}" \ 29 | description="${DESCRIPTION}" \ 30 | io.k8s.description="${DESCRIPTION}" \ 31 | io.k8s.display-name="MariaDB ${MYSQL_VERSION}" \ 32 | io.openshift.expose-services="3306:mysql" \ 33 | io.openshift.tags="database,mysql,${NAME},${NAME}${MYSQL_SHORT_VERSION},${NAME}-${MYSQL_SHORT_VERSION}" \ 34 | com.redhat.component="${NAME}-${MYSQL_SHORT_VERSION}-container" \ 35 | name="sclorg/${NAME}-${MYSQL_SHORT_VERSION}-c10s" \ 36 | version="1" \ 37 | com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \ 38 | usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 quay.io/sclorg/${NAME}-${MYSQL_SHORT_VERSION}-c10s" \ 39 | maintainer="SoftwareCollections.org " 40 | 41 | EXPOSE 3306 42 | 43 | # This image must forever use UID 27 for mysql user so our volumes are 44 | # safe in the future. This should *never* change, the last test is there 45 | # to make sure of that. 46 | RUN INSTALL_PKGS="policycoreutils rsync tar xz gettext hostname bind-utils groff-base" && \ 47 | dnf install -y --setopt=tsflags=nodocs ${INSTALL_PKGS} ${NAME}${MYSQL_VERSION}-server && \ 48 | /usr/libexec/mysqld -V | grep -qe "${MYSQL_VERSION}\." && echo "Found VERSION ${MYSQL_VERSION}" && \ 49 | dnf -y clean all --enablerepo='*' && \ 50 | mkdir -p ${HOME}/data && chown -R mysql:root ${HOME} && \ 51 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 52 | 53 | # Get prefix path and path to scripts rather than hard-code them in scripts 54 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 55 | MYSQL_PREFIX=/usr 56 | 57 | COPY ${MYSQL_VERSION}/root-common / 58 | COPY ${MYSQL_VERSION}/s2i-common/bin/ ${STI_SCRIPTS_PATH} 59 | COPY ${MYSQL_VERSION}/root / 60 | 61 | # Hard links are not supported in Testing Farm approach during sync to guest 62 | # operation system. Therefore tests are failing on error 63 | # /usr/libexec/s2i/run no such file or directory 64 | RUN ln -s /usr/bin/run-mysqld ${STI_SCRIPTS_PATH}/run 65 | 66 | # this is needed due to issues with squash 67 | # when this directory gets rm'd by the container-setup 68 | # script. 69 | # Also reset permissions of filesystem to default values 70 | RUN rm -rf /etc/my.cnf.d/* && \ 71 | /usr/libexec/container-setup && \ 72 | rpm-file-permissions 73 | 74 | USER 27 75 | 76 | ENTRYPOINT ["container-entrypoint"] 77 | CMD ["run-mysqld"] 78 | -------------------------------------------------------------------------------- /10.11/Dockerfile.c8s: -------------------------------------------------------------------------------- 1 | FROM quay.io/sclorg/s2i-core-c8s:c8s 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | 13 | ENV MYSQL_VERSION=10.11 \ 14 | APP_DATA=/opt/app-root/src \ 15 | HOME=/var/lib/mysql \ 16 | SUMMARY="MariaDB 10.11 SQL database server" \ 17 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 18 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 19 | The mysqld server daemon accepts connections from clients and provides access to content from \ 20 | MariaDB databases on behalf of the clients." 21 | 22 | LABEL summary="$SUMMARY" \ 23 | description="$DESCRIPTION" \ 24 | io.k8s.description="$DESCRIPTION" \ 25 | io.k8s.display-name="MariaDB 10.11" \ 26 | io.openshift.expose-services="3306:mysql" \ 27 | io.openshift.tags="database,mysql,mariadb,mariadb1011,mariadb-1011" \ 28 | com.redhat.component="mariadb-1011-container" \ 29 | name="sclorg/mariadb-1011-c8s" \ 30 | version="1" \ 31 | usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 quay.io/sclorg/mariadb-1011-c8s" \ 32 | maintainer="SoftwareCollections.org " 33 | 34 | EXPOSE 3306 35 | 36 | # This image must forever use UID 27 for mysql user so our volumes are 37 | # safe in the future. This should *never* change, the last test is there 38 | # to make sure of that. 39 | RUN yum -y module enable mariadb:$MYSQL_VERSION && \ 40 | INSTALL_PKGS="policycoreutils rsync tar gettext hostname bind-utils groff-base mariadb-server" && \ 41 | yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 42 | rpm -V $INSTALL_PKGS && \ 43 | /usr/libexec/mysqld -V | grep -qe "$MYSQL_VERSION\." && echo "Found VERSION $MYSQL_VERSION" && \ 44 | yum -y clean all --enablerepo='*' && \ 45 | mkdir -p /var/lib/mysql/data && chown -R mysql:root /var/lib/mysql && \ 46 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 47 | 48 | # Get prefix path and path to scripts rather than hard-code them in scripts 49 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 50 | MYSQL_PREFIX=/usr 51 | 52 | COPY 10.11/root-common / 53 | COPY 10.11/s2i-common/bin/ $STI_SCRIPTS_PATH 54 | COPY 10.11/root / 55 | 56 | # Hard links are not supported in Testing Farm approach during sync to guest 57 | # operation system. Therefore tests are failing on error 58 | # /usr/libexec/s2i/run no such file or directory 59 | RUN ln -s /usr/bin/run-mysqld $STI_SCRIPTS_PATH/run 60 | 61 | # this is needed due to issues with squash 62 | # when this directory gets rm'd by the container-setup 63 | # script. 64 | # Also reset permissions of filesystem to default values 65 | RUN rm -rf /etc/my.cnf.d/* && \ 66 | /usr/libexec/container-setup && \ 67 | rpm-file-permissions 68 | 69 | USER 27 70 | 71 | ENTRYPOINT ["container-entrypoint"] 72 | CMD ["run-mysqld"] 73 | -------------------------------------------------------------------------------- /10.11/Dockerfile.c9s: -------------------------------------------------------------------------------- 1 | FROM quay.io/sclorg/s2i-core-c9s:c9s 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | 13 | # Standalone ENV call so these values can be re-used in the other ENV calls 14 | ENV MYSQL_VERSION=10.11 \ 15 | MYSQL_SHORT_VERSION=1011 16 | 17 | ENV VERSION="${MYSQL_VERSION}" \ 18 | APP_DATA=/opt/app-root/src \ 19 | HOME=/var/lib/mysql \ 20 | NAME=mariadb \ 21 | SUMMARY="MariaDB ${MYSQL_VERSION} SQL database server" \ 22 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 23 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 24 | The mysqld server daemon accepts connections from clients and provides access to content from \ 25 | MariaDB databases on behalf of the clients." 26 | 27 | LABEL summary="${SUMMARY}" \ 28 | description="${DESCRIPTION}" \ 29 | io.k8s.description="${DESCRIPTION}" \ 30 | io.k8s.display-name="MariaDB ${MYSQL_VERSION}" \ 31 | io.openshift.expose-services="3306:mysql" \ 32 | io.openshift.tags="database,mysql,${NAME},${NAME}${MYSQL_SHORT_VERSION},${NAME}-${MYSQL_SHORT_VERSION}" \ 33 | com.redhat.component="${NAME}-${MYSQL_SHORT_VERSION}-container" \ 34 | name="sclorg/${NAME}-${MYSQL_SHORT_VERSION}-c9s" \ 35 | version="1" \ 36 | com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \ 37 | usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 quay.io/sclorg/${NAME}-${MYSQL_SHORT_VERSION}-c9s" \ 38 | maintainer="SoftwareCollections.org " 39 | 40 | EXPOSE 3306 41 | 42 | # This image must forever use UID 27 for mysql user so our volumes are 43 | # safe in the future. This should *never* change, the last test is there 44 | # to make sure of that. 45 | RUN yum -y module enable ${NAME}:${MYSQL_VERSION} && \ 46 | INSTALL_PKGS="policycoreutils rsync tar gettext hostname bind-utils groff-base ${NAME}-server" && \ 47 | yum install -y --setopt=tsflags=nodocs ${INSTALL_PKGS} && \ 48 | rpm -V ${INSTALL_PKGS} && \ 49 | /usr/libexec/mysqld -V | grep -qe "${MYSQL_VERSION}\." && echo "Found VERSION ${MYSQL_VERSION}" && \ 50 | yum -y clean all --enablerepo='*' && \ 51 | mkdir -p ${HOME}/data && chown -R mysql:root ${HOME} && \ 52 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 53 | 54 | # Get prefix path and path to scripts rather than hard-code them in scripts 55 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 56 | MYSQL_PREFIX=/usr 57 | 58 | COPY ${MYSQL_VERSION}/root-common / 59 | COPY ${MYSQL_VERSION}/s2i-common/bin/ ${STI_SCRIPTS_PATH} 60 | COPY ${MYSQL_VERSION}/root / 61 | 62 | # Hard links are not supported in Testing Farm approach during sync to guest 63 | # operation system. Therefore tests are failing on error 64 | # /usr/libexec/s2i/run no such file or directory 65 | RUN ln -s /usr/bin/run-mysqld ${STI_SCRIPTS_PATH}/run 66 | 67 | # this is needed due to issues with squash 68 | # when this directory gets rm'd by the container-setup 69 | # script. 70 | # Also reset permissions of filesystem to default values 71 | RUN rm -rf /etc/my.cnf.d/* && \ 72 | /usr/libexec/container-setup && \ 73 | rpm-file-permissions 74 | 75 | USER 27 76 | 77 | ENTRYPOINT ["container-entrypoint"] 78 | CMD ["run-mysqld"] 79 | -------------------------------------------------------------------------------- /10.11/Dockerfile.fedora: -------------------------------------------------------------------------------- 1 | FROM quay.io/fedora/s2i-core:42 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | 13 | # Standalone ENV call so these values can be re-used in the other ENV calls 14 | ENV MYSQL_VERSION=10.11 \ 15 | MYSQL_SHORT_VERSION=1011 16 | 17 | ENV VERSION="${MYSQL_VERSION}" \ 18 | APP_DATA=/opt/app-root/src \ 19 | HOME=/var/lib/mysql \ 20 | NAME=mariadb \ 21 | ARCH=x86_64 \ 22 | SUMMARY="MariaDB ${MYSQL_VERSION} SQL database server" \ 23 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 24 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 25 | The mysqld server daemon accepts connections from clients and provides access to content from \ 26 | MariaDB databases on behalf of the clients." 27 | 28 | LABEL summary="${SUMMARY}" \ 29 | description="${DESCRIPTION}" \ 30 | io.k8s.description="${DESCRIPTION}" \ 31 | io.k8s.display-name="MariaDB ${MYSQL_VERSION}" \ 32 | io.openshift.expose-services="3306:mysql" \ 33 | io.openshift.tags="database,mysql,${NAME},${NAME}${MYSQL_SHORT_VERSION},${NAME}-${MYSQL_SHORT_VERSION}" \ 34 | com.redhat.component="${NAME}" \ 35 | name="fedora/${NAME}-${MYSQL_SHORT_VERSION}" \ 36 | version="${MYSQL_VERSION}" \ 37 | usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 quay.io/fedora/${NAME}-${MYSQL_SHORT_VERSION}" \ 38 | maintainer="SoftwareCollections.org " 39 | 40 | EXPOSE 3306 41 | 42 | # This image must forever use UID 27 for mysql user so our volumes are safe in the future. This should *never* change. 43 | # Instead of relying on the DB server package, we will do the setup ourselves before any package is installed 44 | RUN /usr/sbin/groupadd -g 27 -o -r mysql && \ 45 | /usr/sbin/useradd -M -N -g mysql -o -r -d ${HOME} -s /sbin/nologin -c "MySQL Server" -u 27 mysql && \ 46 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" && \ 47 | INSTALL_PKGS="policycoreutils rsync tar gettext hostname bind-utils groff-base" && \ 48 | dnf install -y --setopt=tsflags=nodocs --setopt=install_weak_deps=False ${INSTALL_PKGS} ${NAME}${MYSQL_VERSION}-server && \ 49 | /usr/libexec/mysqld -V | grep -qe "${MYSQL_VERSION}\." && echo "Found VERSION ${MYSQL_VERSION}" && \ 50 | dnf -y clean all --enablerepo='*' && \ 51 | mkdir -p ${HOME}/data && chown -R mysql:root ${HOME} && \ 52 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 53 | 54 | # Get prefix path and path to scripts rather than hard-code them in scripts 55 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 56 | MYSQL_PREFIX=/usr 57 | 58 | COPY ${MYSQL_VERSION}/root-common / 59 | COPY ${MYSQL_VERSION}/s2i-common/bin/ ${STI_SCRIPTS_PATH} 60 | COPY ${MYSQL_VERSION}/root / 61 | 62 | # Hard links are not supported in Testing Farm approach during sync to guest 63 | # operation system. Therefore tests are failing on error 64 | # /usr/libexec/s2i/run no such file or directory 65 | RUN ln -s /usr/bin/run-mysqld ${STI_SCRIPTS_PATH}/run 66 | 67 | # this is needed due to issues with squash 68 | # when this directory gets rm'd by the container-setup 69 | # script. 70 | # Also reset permissions of filesystem to default values 71 | RUN rm -rf /etc/my.cnf.d/* && \ 72 | /usr/libexec/container-setup && \ 73 | rpm-file-permissions 74 | 75 | USER 27 76 | 77 | ENTRYPOINT ["container-entrypoint"] 78 | CMD ["run-mysqld"] 79 | -------------------------------------------------------------------------------- /10.11/Dockerfile.rhel10: -------------------------------------------------------------------------------- 1 | FROM ubi10/s2i-core 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | 13 | # Standalone ENV call so these values can be re-used in the other ENV calls 14 | ENV MYSQL_VERSION=10.11 \ 15 | MYSQL_SHORT_VERSION=1011 16 | 17 | ENV VERSION="${MYSQL_VERSION}" \ 18 | APP_DATA=/opt/app-root/src \ 19 | HOME=/var/lib/mysql \ 20 | NAME=mariadb \ 21 | SUMMARY="MariaDB ${MYSQL_VERSION} SQL database server" \ 22 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 23 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 24 | The mysqld server daemon accepts connections from clients and provides access to content from \ 25 | MariaDB databases on behalf of the clients." 26 | 27 | LABEL summary="${SUMMARY}" \ 28 | description="${DESCRIPTION}" \ 29 | io.k8s.description="${DESCRIPTION}" \ 30 | io.k8s.display-name="MariaDB ${MYSQL_VERSION}" \ 31 | io.openshift.expose-services="3306:mysql" \ 32 | io.openshift.tags="database,mysql,${NAME},${NAME}${MYSQL_SHORT_VERSION},${NAME}-${MYSQL_SHORT_VERSION}" \ 33 | com.redhat.component="${NAME}-${MYSQL_SHORT_VERSION}-container" \ 34 | name="rhel10/${NAME}-${MYSQL_SHORT_VERSION}" \ 35 | version="1" \ 36 | com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \ 37 | usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 rhel10/${NAME}-${MYSQL_SHORT_VERSION}" \ 38 | maintainer="SoftwareCollections.org " 39 | 40 | EXPOSE 3306 41 | 42 | # This image must forever use UID 27 for mysql user so our volumes are 43 | # safe in the future. This should *never* change, the last test is there 44 | # to make sure of that. 45 | RUN INSTALL_PKGS="policycoreutils rsync tar xz gettext hostname bind-utils groff-base" && \ 46 | dnf install -y --setopt=tsflags=nodocs ${INSTALL_PKGS} ${NAME}${MYSQL_VERSION}-server && \ 47 | /usr/libexec/mysqld -V | grep -qe "${MYSQL_VERSION}\." && echo "Found VERSION ${MYSQL_VERSION}" && \ 48 | dnf -y clean all --enablerepo='*' && \ 49 | mkdir -p ${HOME}/data && chown -R mysql:root ${HOME} && \ 50 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 51 | 52 | # Get prefix path and path to scripts rather than hard-code them in scripts 53 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 54 | MYSQL_PREFIX=/usr 55 | 56 | COPY ${MYSQL_VERSION}/root-common / 57 | COPY ${MYSQL_VERSION}/s2i-common/bin/ ${STI_SCRIPTS_PATH} 58 | COPY ${MYSQL_VERSION}/root / 59 | 60 | # Hard links are not supported in Testing Farm approach during sync to guest 61 | # operation system. Therefore tests are failing on error 62 | # /usr/libexec/s2i/run no such file or directory 63 | RUN ln -s /usr/bin/run-mysqld ${STI_SCRIPTS_PATH}/run 64 | 65 | # this is needed due to issues with squash 66 | # when this directory gets rm'd by the container-setup 67 | # script. 68 | # Also reset permissions of filesystem to default values 69 | RUN rm -rf /etc/my.cnf.d/* && \ 70 | /usr/libexec/container-setup && \ 71 | rpm-file-permissions 72 | 73 | USER 27 74 | 75 | ENTRYPOINT ["container-entrypoint"] 76 | CMD ["run-mysqld"] 77 | -------------------------------------------------------------------------------- /10.11/Dockerfile.rhel8: -------------------------------------------------------------------------------- 1 | FROM ubi8/s2i-core 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | 13 | ENV MYSQL_VERSION=10.11 \ 14 | APP_DATA=/opt/app-root/src \ 15 | HOME=/var/lib/mysql \ 16 | SUMMARY="MariaDB 10.11 SQL database server" \ 17 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 18 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 19 | The mysqld server daemon accepts connections from clients and provides access to content from \ 20 | MariaDB databases on behalf of the clients." 21 | 22 | LABEL summary="$SUMMARY" \ 23 | description="$DESCRIPTION" \ 24 | io.k8s.description="$DESCRIPTION" \ 25 | io.k8s.display-name="MariaDB 10.11" \ 26 | io.openshift.expose-services="3306:mysql" \ 27 | io.openshift.tags="database,mysql,mariadb,mariadb1011,mariadb-1011" \ 28 | com.redhat.component="mariadb-1011-container" \ 29 | name="rhel8/mariadb-1011" \ 30 | version="1" \ 31 | usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 rhel8/mariadb-1011" \ 32 | maintainer="SoftwareCollections.org " 33 | 34 | EXPOSE 3306 35 | 36 | # This image must forever use UID 27 for mysql user so our volumes are 37 | # safe in the future. This should *never* change, the last test is there 38 | # to make sure of that. 39 | RUN yum -y module enable mariadb:$MYSQL_VERSION && \ 40 | INSTALL_PKGS="policycoreutils rsync tar gettext hostname bind-utils groff-base mariadb-server" && \ 41 | yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 42 | rpm -V $INSTALL_PKGS && \ 43 | /usr/libexec/mysqld -V | grep -qe "$MYSQL_VERSION\." && echo "Found VERSION $MYSQL_VERSION" && \ 44 | yum -y clean all --enablerepo='*' && \ 45 | mkdir -p /var/lib/mysql/data && chown -R mysql:root /var/lib/mysql && \ 46 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 47 | 48 | # Get prefix path and path to scripts rather than hard-code them in scripts 49 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 50 | MYSQL_PREFIX=/usr 51 | 52 | COPY 10.11/root-common / 53 | COPY 10.11/s2i-common/bin/ $STI_SCRIPTS_PATH 54 | COPY 10.11/root / 55 | 56 | # Hard links are not supported in Testing Farm approach during sync to guest 57 | # operation system. Therefore tests are failing on error 58 | # /usr/libexec/s2i/run no such file or directory 59 | RUN ln -s /usr/bin/run-mysqld $STI_SCRIPTS_PATH/run 60 | 61 | # this is needed due to issues with squash 62 | # when this directory gets rm'd by the container-setup 63 | # script. 64 | # Also reset permissions of filesystem to default values 65 | RUN rm -rf /etc/my.cnf.d/* && \ 66 | /usr/libexec/container-setup && \ 67 | rpm-file-permissions 68 | 69 | USER 27 70 | 71 | ENTRYPOINT ["container-entrypoint"] 72 | CMD ["run-mysqld"] 73 | -------------------------------------------------------------------------------- /10.11/Dockerfile.rhel9: -------------------------------------------------------------------------------- 1 | FROM ubi9/s2i-core 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | 13 | # Standalone ENV call so these values can be re-used in the other ENV calls 14 | ENV MYSQL_VERSION=10.11 \ 15 | MYSQL_SHORT_VERSION=1011 16 | 17 | ENV VERSION="${MYSQL_VERSION}" \ 18 | APP_DATA=/opt/app-root/src \ 19 | HOME=/var/lib/mysql \ 20 | NAME=mariadb \ 21 | SUMMARY="MariaDB ${MYSQL_VERSION} SQL database server" \ 22 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 23 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 24 | The mysqld server daemon accepts connections from clients and provides access to content from \ 25 | MariaDB databases on behalf of the clients." 26 | 27 | LABEL summary="${SUMMARY}" \ 28 | description="${DESCRIPTION}" \ 29 | io.k8s.description="${DESCRIPTION}" \ 30 | io.k8s.display-name="MariaDB ${MYSQL_VERSION}" \ 31 | io.openshift.expose-services="3306:mysql" \ 32 | io.openshift.tags="database,mysql,${NAME},${NAME}${MYSQL_SHORT_VERSION},${NAME}-${MYSQL_SHORT_VERSION}" \ 33 | com.redhat.component="${NAME}-${MYSQL_SHORT_VERSION}-container" \ 34 | name="rhel9/${NAME}-${MYSQL_SHORT_VERSION}" \ 35 | version="1" \ 36 | com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \ 37 | usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 rhel9/${NAME}-${MYSQL_SHORT_VERSION}" \ 38 | maintainer="SoftwareCollections.org " 39 | 40 | EXPOSE 3306 41 | 42 | # This image must forever use UID 27 for mysql user so our volumes are 43 | # safe in the future. This should *never* change, the last test is there 44 | # to make sure of that. 45 | RUN yum -y module enable ${NAME}:${MYSQL_VERSION} && \ 46 | INSTALL_PKGS="policycoreutils rsync tar gettext hostname bind9.18-utils groff-base ${NAME}-server" && \ 47 | yum install -y --setopt=tsflags=nodocs ${INSTALL_PKGS} && \ 48 | rpm -V ${INSTALL_PKGS} && \ 49 | /usr/libexec/mysqld -V | grep -qe "${MYSQL_VERSION}\." && echo "Found VERSION ${MYSQL_VERSION}" && \ 50 | yum -y clean all --enablerepo='*' && \ 51 | mkdir -p ${HOME}/data && chown -R mysql:root ${HOME} && \ 52 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 53 | 54 | # Get prefix path and path to scripts rather than hard-code them in scripts 55 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 56 | MYSQL_PREFIX=/usr 57 | 58 | COPY ${MYSQL_VERSION}/root-common / 59 | COPY ${MYSQL_VERSION}/s2i-common/bin/ ${STI_SCRIPTS_PATH} 60 | COPY ${MYSQL_VERSION}/root / 61 | 62 | # Hard links are not supported in Testing Farm approach during sync to guest 63 | # operation system. Therefore tests are failing on error 64 | # /usr/libexec/s2i/run no such file or directory 65 | RUN ln -s /usr/bin/run-mysqld ${STI_SCRIPTS_PATH}/run 66 | 67 | # this is needed due to issues with squash 68 | # when this directory gets rm'd by the container-setup 69 | # script. 70 | # Also reset permissions of filesystem to default values 71 | RUN rm -rf /etc/my.cnf.d/* && \ 72 | /usr/libexec/container-setup && \ 73 | rpm-file-permissions 74 | 75 | USER 27 76 | 77 | ENTRYPOINT ["container-entrypoint"] 78 | CMD ["run-mysqld"] 79 | -------------------------------------------------------------------------------- /10.11/README.md: -------------------------------------------------------------------------------- 1 | root/usr/share/container-scripts/mysql/README.md -------------------------------------------------------------------------------- /10.11/root-common: -------------------------------------------------------------------------------- 1 | ../root-common -------------------------------------------------------------------------------- /10.11/s2i-common: -------------------------------------------------------------------------------- 1 | ../s2i-common -------------------------------------------------------------------------------- /10.11/test: -------------------------------------------------------------------------------- 1 | ../test -------------------------------------------------------------------------------- /10.3/.exclude-c8s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/mariadb-container/6529b302e016a82afcb4e1c4cbae4d61824e4c78/10.3/.exclude-c8s -------------------------------------------------------------------------------- /10.3/.exclude-centos7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/mariadb-container/6529b302e016a82afcb4e1c4cbae4d61824e4c78/10.3/.exclude-centos7 -------------------------------------------------------------------------------- /10.3/.exclude-fedora: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/mariadb-container/6529b302e016a82afcb4e1c4cbae4d61824e4c78/10.3/.exclude-fedora -------------------------------------------------------------------------------- /10.3/.exclude-rhel7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/mariadb-container/6529b302e016a82afcb4e1c4cbae4d61824e4c78/10.3/.exclude-rhel7 -------------------------------------------------------------------------------- /10.3/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/centos7/s2i-core-centos7 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | # * $MYSQL_CHARSET (Optional) - Default character set 13 | # * $MYSQL_COLLATION (Optional) - Default collation 14 | 15 | ENV MYSQL_VERSION=10.3 \ 16 | APP_DATA=/opt/app-root/src \ 17 | HOME=/var/lib/mysql \ 18 | SUMMARY="MariaDB 10.3 SQL database server" \ 19 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 20 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 21 | The mysqld server daemon accepts connections from clients and provides access to content from \ 22 | MariaDB databases on behalf of the clients." 23 | 24 | LABEL summary="$SUMMARY" \ 25 | description="$DESCRIPTION" \ 26 | io.k8s.description="$DESCRIPTION" \ 27 | io.k8s.display-name="MariaDB 10.3" \ 28 | io.openshift.expose-services="3306:mysql" \ 29 | io.openshift.tags="database,mysql,mariadb,mariadb103,rh-mariadb103,galera" \ 30 | com.redhat.component="rh-mariadb103-container" \ 31 | name="centos7/mariadb-103-centos7" \ 32 | usage="docker run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 quay.io/centos7/mariadb-103-centos7" \ 33 | maintainer="SoftwareCollections.org " 34 | 35 | EXPOSE 3306 36 | 37 | # This image must forever use UID 27 for mysql user so our volumes are 38 | # safe in the future. This should *never* change, the last test is there 39 | # to make sure of that. 40 | RUN yum install -y centos-release-scl-rh && \ 41 | INSTALL_PKGS="rsync tar gettext hostname bind-utils groff-base rh-mariadb103 rh-mariadb103-mariadb-server-utils rh-mariadb103-mariadb-syspaths" && \ 42 | yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 43 | rpm -V $INSTALL_PKGS && \ 44 | yum -y clean all --enablerepo='*' && \ 45 | mkdir -p /var/lib/mysql/data && chown -R mysql.0 /var/lib/mysql && \ 46 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 47 | 48 | # Get prefix path and path to scripts rather than hard-code them in scripts 49 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 50 | MYSQL_PREFIX=/opt/rh/rh-mariadb103/root/usr \ 51 | ENABLED_COLLECTIONS=rh-mariadb103 52 | 53 | # When bash is started non-interactively, to run a shell script, for example it 54 | # looks for this variable and source the content of this file. This will enable 55 | # the SCL for all scripts without need to do 'scl enable'. 56 | ENV BASH_ENV=${CONTAINER_SCRIPTS_PATH}/scl_enable \ 57 | ENV=${CONTAINER_SCRIPTS_PATH}/scl_enable \ 58 | PROMPT_COMMAND=". ${CONTAINER_SCRIPTS_PATH}/scl_enable" 59 | 60 | COPY 10.3/root-common / 61 | COPY 10.3/s2i-common/bin/ $STI_SCRIPTS_PATH 62 | COPY 10.3/root / 63 | 64 | # Hard links are not supported in Testing Farm approach during sync to guest 65 | # operation system. Therefore tests are failing on error 66 | # /usr/libexec/s2i/run no such file or directory 67 | RUN ln -s /bin/run-mysqld $STI_SCRIPTS_PATH/run 68 | 69 | # this is needed due to issues with squash 70 | # when this directory gets rm'd by the container-setup 71 | # script. 72 | # Also reset permissions of filesystem to default values 73 | RUN rm -rf /etc/my.cnf.d/* && \ 74 | /usr/libexec/container-setup && \ 75 | rpm-file-permissions 76 | 77 | USER 27 78 | 79 | ENTRYPOINT ["container-entrypoint"] 80 | CMD ["run-mysqld"] 81 | -------------------------------------------------------------------------------- /10.3/Dockerfile.c8s: -------------------------------------------------------------------------------- 1 | FROM quay.io/sclorg/s2i-core-c8s:c8s 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | 13 | ENV MYSQL_VERSION=10.3 \ 14 | APP_DATA=/opt/app-root/src \ 15 | HOME=/var/lib/mysql \ 16 | SUMMARY="MariaDB 10.3 SQL database server" \ 17 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 18 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 19 | The mysqld server daemon accepts connections from clients and provides access to content from \ 20 | MariaDB databases on behalf of the clients." 21 | 22 | LABEL summary="$SUMMARY" \ 23 | description="$DESCRIPTION" \ 24 | io.k8s.description="$DESCRIPTION" \ 25 | io.k8s.display-name="MariaDB 10.3" \ 26 | io.openshift.expose-services="3306:mysql" \ 27 | io.openshift.tags="database,mysql,mariadb,mariadb103,mariadb-103" \ 28 | com.redhat.component="mariadb-103-container" \ 29 | name="sclorg/mariadb-103-c8s" \ 30 | version="1" \ 31 | usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 quay.io/sclorg/mariadb-103-c8s" \ 32 | maintainer="SoftwareCollections.org " 33 | 34 | EXPOSE 3306 35 | 36 | # This image must forever use UID 27 for mysql user so our volumes are 37 | # safe in the future. This should *never* change, the last test is there 38 | # to make sure of that. 39 | RUN yum -y module enable mariadb:$MYSQL_VERSION && \ 40 | INSTALL_PKGS="policycoreutils rsync tar gettext hostname bind-utils groff-base mariadb-server" && \ 41 | yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 42 | rpm -V $INSTALL_PKGS && \ 43 | /usr/libexec/mysqld -V | grep -qe "$MYSQL_VERSION\." && echo "Found VERSION $MYSQL_VERSION" && \ 44 | yum -y clean all --enablerepo='*' && \ 45 | mkdir -p /var/lib/mysql/data && chown -R mysql.0 /var/lib/mysql && \ 46 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 47 | 48 | # Get prefix path and path to scripts rather than hard-code them in scripts 49 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 50 | MYSQL_PREFIX=/usr 51 | 52 | COPY 10.3/root-common / 53 | COPY 10.3/s2i-common/bin/ $STI_SCRIPTS_PATH 54 | COPY 10.3/root / 55 | 56 | # Hard links are not supported in Testing Farm approach during sync to guest 57 | # operation system. Therefore tests are failing on error 58 | # /usr/libexec/s2i/run no such file or directory 59 | RUN ln -s /bin/run-mysqld $STI_SCRIPTS_PATH/run 60 | 61 | # this is needed due to issues with squash 62 | # when this directory gets rm'd by the container-setup 63 | # script. 64 | # Also reset permissions of filesystem to default values 65 | RUN rm -rf /etc/my.cnf.d/* && \ 66 | /usr/libexec/container-setup && \ 67 | rpm-file-permissions 68 | 69 | USER 27 70 | 71 | ENTRYPOINT ["container-entrypoint"] 72 | CMD ["run-mysqld"] 73 | -------------------------------------------------------------------------------- /10.3/Dockerfile.fedora: -------------------------------------------------------------------------------- 1 | FROM quay.io/fedora/s2i-core:35 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | 13 | ENV MYSQL_VERSION=10.3 \ 14 | APP_DATA=/opt/app-root/src \ 15 | HOME=/var/lib/mysql \ 16 | NAME=mariadb \ 17 | VERSION=10.3 \ 18 | ARCH=x86_64 \ 19 | SUMMARY="MariaDB 10.3 SQL database server" \ 20 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 21 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 22 | The mysqld server daemon accepts connections from clients and provides access to content from \ 23 | MariaDB databases on behalf of the clients." 24 | 25 | LABEL summary="$SUMMARY" \ 26 | description="$DESCRIPTION" \ 27 | io.k8s.description="MariaDB is a multi-user, multi-threaded SQL database server" \ 28 | io.k8s.display-name="MariaDB 10.3" \ 29 | io.openshift.expose-services="3306:mysql" \ 30 | io.openshift.tags="database,mysql,mariadb,mariadb103,galera" \ 31 | com.redhat.component="$NAME" \ 32 | name="fedora/$NAME-103" \ 33 | version="$VERSION" \ 34 | usage="docker run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 quay.io/fedora/$NAME-103" \ 35 | maintainer="SoftwareCollections.org " 36 | 37 | EXPOSE 3306 38 | 39 | # This image must forever use UID 27 for mysql user so our volumes are 40 | # safe in the future. This should *never* change, the last test is there 41 | # to make sure of that. 42 | RUN yum -y module enable mariadb:$MYSQL_VERSION && \ 43 | INSTALL_PKGS="rsync tar gettext hostname bind-utils groff-base mariadb mariadb-server policycoreutils" && \ 44 | dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 45 | rpm -V $INSTALL_PKGS && \ 46 | /usr/libexec/mysqld -V | grep -qe "$MYSQL_VERSION\." && echo "Found VERSION $MYSQL_VERSION" && \ 47 | dnf clean all && \ 48 | mkdir -p /var/lib/mysql/data && chown -R mysql.0 /var/lib/mysql && \ 49 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 50 | 51 | # Get prefix path and path to scripts rather than hard-code them in scripts 52 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 53 | MYSQL_PREFIX=/usr 54 | 55 | COPY 10.3/root-common / 56 | COPY 10.3/s2i-common/bin/ $STI_SCRIPTS_PATH 57 | COPY 10.3/root / 58 | 59 | # Hard links are not supported in Testing Farm approach during sync to guest 60 | # operation system. Therefore tests are failing on error 61 | # /usr/libexec/s2i/run no such file or directory 62 | RUN ln -s /bin/run-mysqld $STI_SCRIPTS_PATH/run 63 | 64 | # this is needed due to issues with squash 65 | # when this directory gets rm'd by the container-setup 66 | # script. 67 | # Also reset permissions of filesystem to default values 68 | RUN rm -rf /etc/my.cnf.d/* && \ 69 | /usr/libexec/container-setup && \ 70 | rpm-file-permissions 71 | 72 | USER 27 73 | 74 | ENTRYPOINT ["container-entrypoint"] 75 | CMD ["run-mysqld"] 76 | -------------------------------------------------------------------------------- /10.3/Dockerfile.rhel7: -------------------------------------------------------------------------------- 1 | FROM rhscl/s2i-core-rhel7 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | 13 | ENV MYSQL_VERSION=10.3 \ 14 | APP_DATA=/opt/app-root/src \ 15 | HOME=/var/lib/mysql \ 16 | SUMMARY="MariaDB 10.3 SQL database server" \ 17 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 18 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 19 | The mysqld server daemon accepts connections from clients and provides access to content from \ 20 | MariaDB databases on behalf of the clients." 21 | 22 | LABEL summary="$SUMMARY" \ 23 | description="$DESCRIPTION" \ 24 | io.k8s.description="$DESCRIPTION" \ 25 | io.k8s.display-name="MariaDB 10.3" \ 26 | io.openshift.expose-services="3306:mysql" \ 27 | io.openshift.tags="database,mysql,mariadb,mariadb103,rh-mariadb103" \ 28 | com.redhat.component="rh-mariadb103-container" \ 29 | name="rhscl/mariadb-103-rhel7" \ 30 | version="1" \ 31 | com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \ 32 | usage="docker run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 rhscl/mariadb-103-rhel7" \ 33 | maintainer="SoftwareCollections.org " 34 | 35 | EXPOSE 3306 36 | 37 | # This image must forever use UID 27 for mysql user so our volumes are 38 | # safe in the future. This should *never* change, the last test is there 39 | # to make sure of that. 40 | RUN yum install -y yum-utils && \ 41 | prepare-yum-repositories rhel-server-rhscl-7-rpms && \ 42 | INSTALL_PKGS="rsync tar gettext hostname bind-utils groff-base rh-mariadb103 rh-mariadb103-mariadb-server-utils rh-mariadb103-mariadb-syspaths" && \ 43 | yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 44 | rpm -V $INSTALL_PKGS && \ 45 | yum -y clean all --enablerepo='*' && \ 46 | mkdir -p /var/lib/mysql/data && chown -R mysql.0 /var/lib/mysql && \ 47 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 48 | 49 | # Get prefix path and path to scripts rather than hard-code them in scripts 50 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 51 | MYSQL_PREFIX=/opt/rh/rh-mariadb103/root/usr \ 52 | ENABLED_COLLECTIONS=rh-mariadb103 53 | 54 | # When bash is started non-interactively, to run a shell script, for example it 55 | # looks for this variable and source the content of this file. This will enable 56 | # the SCL for all scripts without need to do 'scl enable'. 57 | ENV BASH_ENV=${CONTAINER_SCRIPTS_PATH}/scl_enable \ 58 | ENV=${CONTAINER_SCRIPTS_PATH}/scl_enable \ 59 | PROMPT_COMMAND=". ${CONTAINER_SCRIPTS_PATH}/scl_enable" 60 | 61 | COPY 10.3/root-common / 62 | COPY 10.3/s2i-common/bin/ $STI_SCRIPTS_PATH 63 | COPY 10.3/root / 64 | 65 | # Hard links are not supported in Testing Farm approach during sync to guest 66 | # operation system. Therefore tests are failing on error 67 | # /usr/libexec/s2i/run no such file or directory 68 | RUN ln -s /bin/run-mysqld $STI_SCRIPTS_PATH/run 69 | 70 | # this is needed due to issues with squash 71 | # when this directory gets rm'd by the container-setup 72 | # script. 73 | # Also reset permissions of filesystem to default values 74 | RUN rm -rf /etc/my.cnf.d/* && \ 75 | /usr/libexec/container-setup && \ 76 | rpm-file-permissions 77 | 78 | USER 27 79 | 80 | ENTRYPOINT ["container-entrypoint"] 81 | CMD ["run-mysqld"] 82 | -------------------------------------------------------------------------------- /10.3/Dockerfile.rhel8: -------------------------------------------------------------------------------- 1 | FROM ubi8/s2i-core 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | 13 | ENV MYSQL_VERSION=10.3 \ 14 | APP_DATA=/opt/app-root/src \ 15 | HOME=/var/lib/mysql \ 16 | SUMMARY="MariaDB 10.3 SQL database server" \ 17 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 18 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 19 | The mysqld server daemon accepts connections from clients and provides access to content from \ 20 | MariaDB databases on behalf of the clients." 21 | 22 | LABEL summary="$SUMMARY" \ 23 | description="$DESCRIPTION" \ 24 | io.k8s.description="$DESCRIPTION" \ 25 | io.k8s.display-name="MariaDB 10.3" \ 26 | io.openshift.expose-services="3306:mysql" \ 27 | io.openshift.tags="database,mysql,mariadb,mariadb103,mariadb-103" \ 28 | com.redhat.component="mariadb-103-container" \ 29 | name="rhel8/mariadb-103" \ 30 | version="1" \ 31 | usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 rhel8/mariadb-103" \ 32 | maintainer="SoftwareCollections.org " 33 | 34 | EXPOSE 3306 35 | 36 | # This image must forever use UID 27 for mysql user so our volumes are 37 | # safe in the future. This should *never* change, the last test is there 38 | # to make sure of that. 39 | RUN yum -y module enable mariadb:$MYSQL_VERSION && \ 40 | INSTALL_PKGS="policycoreutils rsync tar gettext hostname bind-utils groff-base mariadb-server" && \ 41 | yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 42 | rpm -V $INSTALL_PKGS && \ 43 | /usr/libexec/mysqld -V | grep -qe "$MYSQL_VERSION\." && echo "Found VERSION $MYSQL_VERSION" && \ 44 | yum -y clean all --enablerepo='*' && \ 45 | mkdir -p /var/lib/mysql/data && chown -R mysql.0 /var/lib/mysql && \ 46 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 47 | 48 | # Get prefix path and path to scripts rather than hard-code them in scripts 49 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 50 | MYSQL_PREFIX=/usr 51 | 52 | COPY 10.3/root-common / 53 | COPY 10.3/s2i-common/bin/ $STI_SCRIPTS_PATH 54 | COPY 10.3/root / 55 | 56 | # Hard links are not supported in Testing Farm approach during sync to guest 57 | # operation system. Therefore tests are failing on error 58 | # /usr/libexec/s2i/run no such file or directory 59 | RUN ln -s /bin/run-mysqld $STI_SCRIPTS_PATH/run 60 | 61 | # this is needed due to issues with squash 62 | # when this directory gets rm'd by the container-setup 63 | # script. 64 | # Also reset permissions of filesystem to default values 65 | RUN rm -rf /etc/my.cnf.d/* && \ 66 | /usr/libexec/container-setup && \ 67 | rpm-file-permissions 68 | 69 | USER 27 70 | 71 | ENTRYPOINT ["container-entrypoint"] 72 | CMD ["run-mysqld"] 73 | -------------------------------------------------------------------------------- /10.3/README.md: -------------------------------------------------------------------------------- 1 | root/usr/share/container-scripts/mysql/README.md -------------------------------------------------------------------------------- /10.3/root-common: -------------------------------------------------------------------------------- 1 | ../root-common -------------------------------------------------------------------------------- /10.3/root/usr/share/container-scripts/mysql/README.md: -------------------------------------------------------------------------------- 1 | MariaDB 10.3 SQL Database Server Docker image 2 | ============================================= 3 | 4 | This container image includes MariaDB 10.3 SQL database server for OpenShift and general usage. 5 | Users can choose between RHEL, CentOS and Fedora based images. 6 | The RHEL images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/), 7 | the CentOS Stream images are available on [Quay.io/sclorg](https://quay.io/organization/sclorg), 8 | and the Fedora images are available in [Fedora Registry](https://registry.fedoraproject.org/). 9 | The resulting image can be run using [podman](https://github.com/containers/libpod). 10 | 11 | Note: while the examples in this README are calling `podman`, you can replace any such calls by `docker` with the same arguments 12 | 13 | Description 14 | ----------- 15 | 16 | This container image provides a containerized packaging of the MariaDB mysqld daemon 17 | and client application. The mysqld server daemon accepts connections from clients 18 | and provides access to content from MySQL databases on behalf of the clients. 19 | You can find more information on the MariaDB project from the project Web site 20 | (https://mariadb.org/). 21 | 22 | 23 | Usage 24 | ----- 25 | 26 | For this, we will assume that you are using the MariaDB 10.3 container image from the 27 | Red Hat Container Catalog called `rhel8/mariadb-103`. 28 | If you want to set only the mandatory environment variables and not store 29 | the database in a host directory, execute the following command: 30 | 31 | ``` 32 | $ podman run -d --name mariadb_database -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 rhel8/mariadb-103 33 | ``` 34 | 35 | This will create a container named `mariadb_database` running MySQL with database 36 | `db` and user with credentials `user:pass`. Port 3306 will be exposed and mapped 37 | to the host. If you want your database to be persistent across container executions, 38 | also add a `-v /host/db/path:/var/lib/mysql/data` argument. This will be the MySQL 39 | data directory. 40 | 41 | If the database directory is not initialized, the entrypoint script will first 42 | run [`mysql_install_db`](https://dev.mysql.com/doc/refman/5.6/en/mysql-install-db.html) 43 | and setup necessary database users and passwords. After the database is initialized, 44 | or if it was already present, `mysqld` is executed and will run as PID 1. You can 45 | stop the detached container by running `podman stop mariadb_database`. 46 | 47 | 48 | Environment variables and volumes 49 | --------------------------------- 50 | 51 | The image recognizes the following environment variables that you can set during 52 | initialization by passing `-e VAR=VALUE` to the Docker run command. 53 | 54 | **`MYSQL_USER`** 55 | User name for MySQL account to be created 56 | 57 | **`MYSQL_PASSWORD`** 58 | Password for the user account 59 | 60 | **`MYSQL_DATABASE`** 61 | Database name 62 | 63 | **`MYSQL_ROOT_PASSWORD`** 64 | Password for the root user (optional) 65 | 66 | **`MYSQL_CHARSET`** 67 | Default character set (optional) 68 | 69 | **`MYSQL_COLLATION`** 70 | Default collation (optional) 71 | 72 | 73 | The following environment variables influence the MySQL configuration file. They are all optional. 74 | 75 | **`MYSQL_LOWER_CASE_TABLE_NAMES (default: 0)`** 76 | Sets how the table names are stored and compared 77 | 78 | **`MYSQL_MAX_CONNECTIONS (default: 151)`** 79 | The maximum permitted number of simultaneous client connections 80 | 81 | **`MYSQL_MAX_ALLOWED_PACKET (default: 200M)`** 82 | The maximum size of one packet or any generated/intermediate string 83 | 84 | **`MYSQL_FT_MIN_WORD_LEN (default: 4)`** 85 | The minimum length of the word to be included in a FULLTEXT index 86 | 87 | **`MYSQL_FT_MAX_WORD_LEN (default: 20)`** 88 | The maximum length of the word to be included in a FULLTEXT index 89 | 90 | **`MYSQL_AIO (default: 1)`** 91 | Controls the `innodb_use_native_aio` setting value in case the native AIO is broken. See http://help.directadmin.com/item.php?id=529 92 | 93 | **`MYSQL_TABLE_OPEN_CACHE (default: 400)`** 94 | The number of open tables for all threads 95 | 96 | **`MYSQL_KEY_BUFFER_SIZE (default: 32M or 10% of available memory)`** 97 | The size of the buffer used for index blocks 98 | 99 | **`MYSQL_SORT_BUFFER_SIZE (default: 256K)`** 100 | The size of the buffer used for sorting 101 | 102 | **`MYSQL_READ_BUFFER_SIZE (default: 8M or 5% of available memory)`** 103 | The size of the buffer used for a sequential scan 104 | 105 | **`MYSQL_INNODB_BUFFER_POOL_SIZE (default: 32M or 50% of available memory)`** 106 | The size of the buffer pool where InnoDB caches table and index data 107 | 108 | **`MYSQL_INNODB_LOG_FILE_SIZE (default: 8M or 15% of available memory)`** 109 | The size of each log file in a log group 110 | 111 | **`MYSQL_INNODB_LOG_BUFFER_SIZE (default: 8M or 15% of available memory)`** 112 | The size of the buffer that InnoDB uses to write to the log files on disk 113 | 114 | **`MYSQL_DEFAULTS_FILE (default: /etc/my.cnf)`** 115 | Point to an alternative configuration file 116 | 117 | **`MYSQL_BINLOG_FORMAT (default: statement)`** 118 | Set sets the binlog format, supported values are `row` and `statement` 119 | 120 | **`MYSQL_LOG_QUERIES_ENABLED (default: 0)`** 121 | To enable query logging set this to `1` 122 | 123 | 124 | You can also set the following mount points by passing the `-v /host:/container` flag to Docker. 125 | 126 | **`/var/lib/mysql/data`** 127 | MySQL data directory 128 | 129 | 130 | **Notice: When mouting a directory from the host into the container, ensure that the mounted 131 | directory has the appropriate permissions and that the owner and group of the directory 132 | matches the user UID or name which is running inside the container.** 133 | 134 | 135 | MariaDB auto-tuning 136 | ------------------- 137 | 138 | When the MySQL image is run with the `--memory` parameter set and you didn't 139 | specify value for some parameters, their values will be automatically 140 | calculated based on the available memory. 141 | 142 | **`MYSQL_KEY_BUFFER_SIZE (default: 10%)`** 143 | `key_buffer_size` 144 | 145 | **`MYSQL_READ_BUFFER_SIZE (default: 5%)`** 146 | `read_buffer_size` 147 | 148 | **`MYSQL_INNODB_BUFFER_POOL_SIZE (default: 50%)`** 149 | `innodb_buffer_pool_size` 150 | 151 | **`MYSQL_INNODB_LOG_FILE_SIZE (default: 15%)`** 152 | `innodb_log_file_size` 153 | 154 | **`MYSQL_INNODB_LOG_BUFFER_SIZE (default: 15%)`** 155 | `innodb_log_buffer_size` 156 | 157 | 158 | 159 | MySQL root user 160 | --------------------------------- 161 | The root user has no password set by default, only allowing local connections. 162 | You can set it by setting the `MYSQL_ROOT_PASSWORD` environment variable. This 163 | will allow you to login to the root account remotely. Local connections will 164 | still not require a password. 165 | 166 | To disable remote root access, simply unset `MYSQL_ROOT_PASSWORD` and restart 167 | the container. 168 | 169 | 170 | Changing passwords 171 | ------------------ 172 | 173 | Since passwords are part of the image configuration, the only supported method 174 | to change passwords for the database user (`MYSQL_USER`) and root user is by 175 | changing the environment variables `MYSQL_PASSWORD` and `MYSQL_ROOT_PASSWORD`, 176 | respectively. 177 | 178 | Changing database passwords through SQL statements or any way other than through 179 | the environment variables aforementioned will cause a mismatch between the 180 | values stored in the variables and the actual passwords. Whenever a database 181 | container starts it will reset the passwords to the values stored in the 182 | environment variables. 183 | 184 | 185 | Default my.cnf file 186 | ------------------- 187 | With environment variables we are able to customize a lot of different parameters 188 | or configurations for the mysql bootstrap configurations. If you'd prefer to use 189 | your own configuration file, you can override the `MYSQL_DEFAULTS_FILE` env 190 | variable with the full path of the file you wish to use. For example, the default 191 | location is `/etc/my.cnf` but you can change it to `/etc/mysql/my.cnf` by setting 192 | `MYSQL_DEFAULTS_FILE=/etc/mysql/my.cnf` 193 | 194 | 195 | Extending image 196 | --------------- 197 | This image can be extended in Openshift using the `Source` build strategy or via the standalone 198 | [source-to-image](https://docs.openshift.com/container-platform/4.14/openshift_images/create-images.html#images-create-s2i_create-images) application (where available). 199 | For this, we will assume that you are using the `rhel8/mariadb-103` image, 200 | available via `mariadb:10.3` imagestream tag in Openshift. 201 | 202 | 203 | For example, to build a customized MariaDB database image `my-mariadb-rhel8` 204 | with a configuration from `https://github.com/sclorg/mariadb-container/tree/master/examples/extend-image` run: 205 | 206 | ``` 207 | $ oc new-app mariadb:10.3~https://github.com/sclorg/mariadb-container.git \ 208 | --name my-mariadb-rhel8 \ 209 | --context-dir=examples/extend-image \ 210 | --env MYSQL_OPERATIONS_USER=opuser \ 211 | --env MYSQL_OPERATIONS_PASSWORD=oppass \ 212 | --env MYSQL_DATABASE=opdb \ 213 | --env MYSQL_USER=user \ 214 | --env MYSQL_PASSWORD=pass 215 | ``` 216 | 217 | or via s2i: 218 | 219 | ``` 220 | $ s2i build --context-dir=examples/extend-image https://github.com/sclorg/mariadb-container.git rhel8/mariadb-103 my-mariadb-rhel8 221 | ``` 222 | 223 | The directory passed to Openshift can contain these directories: 224 | 225 | `mysql-cfg/` 226 | When starting the container, files from this directory will be used as 227 | a configuration for the `mysqld` daemon. 228 | `envsubst` command is run on this file to still allow customization of 229 | the image using environmental variables 230 | 231 | `mysql-pre-init/` 232 | Shell scripts (`*.sh`) available in this directory are sourced before 233 | `mysqld` daemon is started. 234 | 235 | `mysql-init/` 236 | Shell scripts (`*.sh`) available in this directory are sourced when 237 | `mysqld` daemon is started locally. In this phase, use `${mysql_flags}` 238 | to connect to the locally running daemon, for example `mysql $mysql_flags < dump.sql` 239 | 240 | Variables that can be used in the scripts provided to s2i: 241 | 242 | `$mysql_flags` 243 | arguments for the `mysql` tool that will connect to the locally running `mysqld` during initialization 244 | 245 | `$MYSQL_RUNNING_AS_MASTER` 246 | variable defined when the container is run with `run-mysqld-master` command 247 | 248 | `$MYSQL_RUNNING_AS_SLAVE` 249 | variable defined when the container is run with `run-mysqld-slave` command 250 | 251 | `$MYSQL_DATADIR_FIRST_INIT` 252 | variable defined when the container was initialized from the empty data dir 253 | 254 | During the s2i build all provided files are copied into `/opt/app-root/src` 255 | directory into the resulting image. If some configuration files are present 256 | in the destination directory, files with the same name are overwritten. 257 | Also only one file with the same name can be used for customization and user 258 | provided files are preferred over default files in 259 | `/usr/share/container-scripts/mysql/`- so it is possible to overwrite them. 260 | 261 | Same configuration directory structure can be used to customize the image 262 | every time the image is started using `podman run`. The directory has to be 263 | mounted into `/opt/app-root/src/` in the image 264 | (`-v ./image-configuration/:/opt/app-root/src/`). 265 | This overwrites customization built into the image. 266 | 267 | 268 | Securing the connection with SSL 269 | -------------------------------- 270 | In order to secure the connection with SSL, use the extending feature described 271 | above. In particular, put the SSL certificates into a separate directory: 272 | 273 | sslapp/mysql-certs/server-cert-selfsigned.pem 274 | sslapp/mysql-certs/server-key.pem 275 | 276 | And then put a separate configuration file into mysql-cfg: 277 | 278 | $> cat sslapp/mysql-cfg/ssl.cnf 279 | [mysqld] 280 | ssl-key=${APP_DATA}/mysql-certs/server-key.pem 281 | ssl-cert=${APP_DATA}/mysql-certs/server-cert-selfsigned.pem 282 | 283 | Such a directory `sslapp` can then be mounted into the container with -v, 284 | or a new container image can be built using s2i. 285 | 286 | 287 | Upgrading and data directory version checking 288 | --------------------------------------------- 289 | 290 | MySQL and MariaDB use versions that consist of three numbers X.Y.Z (e.g. 5.6.23). 291 | For version changes in Z part, the server's binary data format stays compatible and thus no 292 | special upgrade procedure is needed. For upgrades from X.Y to X.Y+1, consider doing manual 293 | steps as described at 294 | https://mariadb.com/kb/en/library/upgrading-from-mariadb-102-to-mariadb-103/ 295 | 296 | Skipping versions like from X.Y to X.Y+2 or downgrading to lower version is not supported; 297 | the only exception is ugrading from MariaDB 5.5 to MariaDB 10.0. 298 | 299 | **Important**: Upgrading to a new version is always risky and users are expected to make a full 300 | back-up of all data before. 301 | 302 | A safer solution to upgrade is to dump all data using `mysqldump` or `mysqldbexport` and then 303 | load the data using `mysql` or `mysqldbimport` into an empty (freshly initialized) database. 304 | 305 | Another way of proceeding with the upgrade is starting the new version of the `mysqld` daemon 306 | and run `mysql_upgrade` right after the start. This so called in-place upgrade is generally 307 | faster for large data directory, but only possible if upgrading from the very previous version, 308 | so skipping versions is not supported. 309 | 310 | This container detects whether the data needs to be upgraded using `mysql_upgrade` and 311 | we can control it by setting `MYSQL_DATADIR_ACTION` variable, which can have one or more of the following values: 312 | 313 | * `upgrade-warn` -- If the data version can be determined and the data come from a different version 314 | of the daemon, a warning is printed but the container starts. This is the default value. 315 | Since historically the version file `mysql_upgrade_info` was not created, when using this option, 316 | the version file is created if not exist, but no `mysql_upgrade` will be called. 317 | However, this automatic creation will be removed after few months, since the version should be 318 | created on most deployments at that point. 319 | * `upgrade-auto` -- `mysql_upgrade` is run at the beginning of the container start, when the local 320 | daemon is running, but only if the data version can be determined and the data come 321 | with the very previous version. A warning is printed if the data come from even older 322 | or newer version. This value effectively enables automatic upgrades, 323 | but it is always risky and users should still back-up all the data before starting the newer container. 324 | Set this option only if you have very good back-ups at any moment and you are fine to fail-over 325 | from the back-up. 326 | * `upgrade-force` -- `mysql_upgrade --force` is run at the beginning of the container start, when the local 327 | daemon is running, no matter what version of the daemon the data come from. 328 | This is also the way to create the missing version file `mysql_upgrade_info` if not present 329 | in the root of the data directory; this file holds information about the version of the data. 330 | 331 | There are also some other actions that you may want to run at the beginning of the container start, 332 | when the local daemon is running, no matter what version of the data is detected: 333 | 334 | * `optimize` -- runs `mysqlcheck --optimize`. It optimizes all the tables. 335 | * `analyze` -- runs `mysqlcheck --analyze`. It analyzes all the tables. 336 | * `disable` -- nothing is done regarding data directory version. 337 | 338 | Multiple values are separated by comma and run in-order, e.g. `MYSQL_DATADIR_ACTION="optimize,analyze"`. 339 | 340 | 341 | Changing the replication binlog_format 342 | -------------------------------------- 343 | Some applications may wish to use `row` binlog_formats (for example, those built 344 | with change-data-capture in mind). The default replication/binlog format is 345 | `statement` but to change it you can set the `MYSQL_BINLOG_FORMAT` environment 346 | variable. For example `MYSQL_BINLOG_FORMAT=row`. Now when you run the database 347 | with `master` replication turned on (ie, set the Docker/container `cmd` to be 348 | `run-mysqld-master`) the binlog will emit the actual data for the rows that change 349 | as opposed to the statements (ie, DML like insert...) that caused the change. 350 | 351 | 352 | Troubleshooting 353 | --------------- 354 | The mysqld deamon in the container logs to the standard output, so the log is available in the container log. The log can be examined by running: 355 | 356 | podman logs 357 | 358 | 359 | See also 360 | -------- 361 | Dockerfile and other sources for this container image are available on 362 | https://github.com/sclorg/mariadb-container. 363 | In that repository, the Dockerfile for RHEL8 is called Dockerfile.rhel8, 364 | the Dockerfile for CentOS Stream 9 is called Dockerfile.c9s, 365 | and the Dockerfile for Fedora is called Dockerfile.fedora. 366 | -------------------------------------------------------------------------------- /10.3/s2i-common: -------------------------------------------------------------------------------- 1 | ../s2i-common -------------------------------------------------------------------------------- /10.3/test: -------------------------------------------------------------------------------- 1 | ../test -------------------------------------------------------------------------------- /10.5/.exclude-c8s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/mariadb-container/6529b302e016a82afcb4e1c4cbae4d61824e4c78/10.5/.exclude-c8s -------------------------------------------------------------------------------- /10.5/.exclude-centos7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/mariadb-container/6529b302e016a82afcb4e1c4cbae4d61824e4c78/10.5/.exclude-centos7 -------------------------------------------------------------------------------- /10.5/.exclude-fedora: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/mariadb-container/6529b302e016a82afcb4e1c4cbae4d61824e4c78/10.5/.exclude-fedora -------------------------------------------------------------------------------- /10.5/.exclude-rhel7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/mariadb-container/6529b302e016a82afcb4e1c4cbae4d61824e4c78/10.5/.exclude-rhel7 -------------------------------------------------------------------------------- /10.5/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/centos7/s2i-core-centos7 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | # * $MYSQL_CHARSET (Optional) - Default character set 13 | # * $MYSQL_COLLATION (Optional) - Default collation 14 | 15 | ENV MYSQL_VERSION=10.5 \ 16 | APP_DATA=/opt/app-root/src \ 17 | HOME=/var/lib/mysql \ 18 | SUMMARY="MariaDB 10.5 SQL database server" \ 19 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 20 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 21 | The mysqld server daemon accepts connections from clients and provides access to content from \ 22 | MariaDB databases on behalf of the clients." 23 | 24 | LABEL summary="$SUMMARY" \ 25 | description="$DESCRIPTION" \ 26 | io.k8s.description="$DESCRIPTION" \ 27 | io.k8s.display-name="MariaDB 10.5" \ 28 | io.openshift.expose-services="3306:mysql" \ 29 | io.openshift.tags="database,mysql,mariadb,mariadb105,rh-mariadb105,galera" \ 30 | com.redhat.component="rh-mariadb105-container" \ 31 | name="centos7/mariadb-105-centos7" \ 32 | usage="docker run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 quay.io/centos7/mariadb-105-centos7" \ 33 | maintainer="SoftwareCollections.org " 34 | 35 | EXPOSE 3306 36 | 37 | # This image must forever use UID 27 for mysql user so our volumes are 38 | # safe in the future. This should *never* change, the last test is there 39 | # to make sure of that. 40 | RUN yum install -y centos-release-scl-rh && \ 41 | INSTALL_PKGS="rsync tar gettext hostname bind-utils groff-base rh-mariadb105 rh-mariadb105-mariadb-server-utils rh-mariadb105-mariadb-syspaths" && \ 42 | yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 43 | rpm -V $INSTALL_PKGS && \ 44 | yum -y clean all --enablerepo='*' && \ 45 | mkdir -p /var/lib/mysql/data && chown -R mysql.0 /var/lib/mysql && \ 46 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 47 | 48 | # Get prefix path and path to scripts rather than hard-code them in scripts 49 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 50 | MYSQL_PREFIX=/opt/rh/rh-mariadb105/root/usr \ 51 | ENABLED_COLLECTIONS=rh-mariadb105 52 | 53 | # When bash is started non-interactively, to run a shell script, for example it 54 | # looks for this variable and source the content of this file. This will enable 55 | # the SCL for all scripts without need to do 'scl enable'. 56 | ENV BASH_ENV=${CONTAINER_SCRIPTS_PATH}/scl_enable \ 57 | ENV=${CONTAINER_SCRIPTS_PATH}/scl_enable \ 58 | PROMPT_COMMAND=". ${CONTAINER_SCRIPTS_PATH}/scl_enable" 59 | 60 | COPY 10.5/root-common / 61 | COPY 10.5/s2i-common/bin/ $STI_SCRIPTS_PATH 62 | COPY 10.5/root / 63 | 64 | # Hard links are not supported in Testing Farm approach during sync to guest 65 | # operation system. Therefore tests are failing on error 66 | # /usr/libexec/s2i/run no such file or directory 67 | RUN ln -s /bin/run-mysqld $STI_SCRIPTS_PATH/run 68 | 69 | # this is needed due to issues with squash 70 | # when this directory gets rm'd by the container-setup 71 | # script. 72 | # Also reset permissions of filesystem to default values 73 | RUN rm -rf /etc/my.cnf.d/* && \ 74 | /usr/libexec/container-setup && \ 75 | rpm-file-permissions 76 | 77 | USER 27 78 | 79 | ENTRYPOINT ["container-entrypoint"] 80 | CMD ["run-mysqld"] 81 | -------------------------------------------------------------------------------- /10.5/Dockerfile.c8s: -------------------------------------------------------------------------------- 1 | FROM quay.io/sclorg/s2i-core-c8s:c8s 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | 13 | ENV MYSQL_VERSION=10.5 \ 14 | APP_DATA=/opt/app-root/src \ 15 | HOME=/var/lib/mysql \ 16 | SUMMARY="MariaDB 10.5 SQL database server" \ 17 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 18 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 19 | The mysqld server daemon accepts connections from clients and provides access to content from \ 20 | MariaDB databases on behalf of the clients." 21 | 22 | LABEL summary="$SUMMARY" \ 23 | description="$DESCRIPTION" \ 24 | io.k8s.description="$DESCRIPTION" \ 25 | io.k8s.display-name="MariaDB 10.5" \ 26 | io.openshift.expose-services="3306:mysql" \ 27 | io.openshift.tags="database,mysql,mariadb,mariadb105,mariadb-105" \ 28 | com.redhat.component="mariadb-105-container" \ 29 | name="sclorg/mariadb-105-c8s" \ 30 | version="1" \ 31 | usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 quay.io/sclorg/mariadb-105-c8s" \ 32 | maintainer="SoftwareCollections.org " 33 | 34 | EXPOSE 3306 35 | 36 | # This image must forever use UID 27 for mysql user so our volumes are 37 | # safe in the future. This should *never* change, the last test is there 38 | # to make sure of that. 39 | RUN yum -y module enable mariadb:$MYSQL_VERSION && \ 40 | INSTALL_PKGS="policycoreutils rsync tar gettext hostname bind-utils groff-base mariadb-server" && \ 41 | yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 42 | rpm -V $INSTALL_PKGS && \ 43 | /usr/libexec/mysqld -V | grep -qe "$MYSQL_VERSION\." && echo "Found VERSION $MYSQL_VERSION" && \ 44 | yum -y clean all --enablerepo='*' && \ 45 | mkdir -p /var/lib/mysql/data && chown -R mysql.0 /var/lib/mysql && \ 46 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 47 | 48 | # Get prefix path and path to scripts rather than hard-code them in scripts 49 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 50 | MYSQL_PREFIX=/usr 51 | 52 | COPY 10.5/root-common / 53 | COPY 10.5/s2i-common/bin/ $STI_SCRIPTS_PATH 54 | COPY 10.5/root / 55 | 56 | # Hard links are not supported in Testing Farm approach during sync to guest 57 | # operation system. Therefore tests are failing on error 58 | # /usr/libexec/s2i/run no such file or directory 59 | RUN ln -s /usr/bin/run-mysqld $STI_SCRIPTS_PATH/run 60 | 61 | # this is needed due to issues with squash 62 | # when this directory gets rm'd by the container-setup 63 | # script. 64 | # Also reset permissions of filesystem to default values 65 | RUN rm -rf /etc/my.cnf.d/* && \ 66 | /usr/libexec/container-setup && \ 67 | rpm-file-permissions 68 | 69 | USER 27 70 | 71 | ENTRYPOINT ["container-entrypoint"] 72 | CMD ["run-mysqld"] 73 | -------------------------------------------------------------------------------- /10.5/Dockerfile.c9s: -------------------------------------------------------------------------------- 1 | FROM quay.io/sclorg/s2i-core-c9s:c9s 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | 13 | # Standalone ENV call so these values can be re-used in the other ENV calls 14 | ENV MYSQL_VERSION=10.5 \ 15 | MYSQL_SHORT_VERSION=105 16 | 17 | ENV VERSION="${MYSQL_VERSION}" \ 18 | APP_DATA=/opt/app-root/src \ 19 | HOME=/var/lib/mysql \ 20 | NAME=mariadb \ 21 | SUMMARY="MariaDB ${MYSQL_VERSION} SQL database server" \ 22 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 23 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 24 | The mysqld server daemon accepts connections from clients and provides access to content from \ 25 | MariaDB databases on behalf of the clients." 26 | 27 | LABEL summary="${SUMMARY}" \ 28 | description="${DESCRIPTION}" \ 29 | io.k8s.description="${DESCRIPTION}" \ 30 | io.k8s.display-name="MariaDB ${MYSQL_VERSION}" \ 31 | io.openshift.expose-services="3306:mysql" \ 32 | io.openshift.tags="database,mysql,${NAME},${NAME}${MYSQL_SHORT_VERSION},${NAME}-${MYSQL_SHORT_VERSION}" \ 33 | com.redhat.component="${NAME}-${MYSQL_SHORT_VERSION}-container" \ 34 | name="sclorg/${NAME}-${MYSQL_SHORT_VERSION}-c9s" \ 35 | version="1" \ 36 | com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \ 37 | usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 quay.io/sclorg/${NAME}-${MYSQL_SHORT_VERSION}-c9s" \ 38 | maintainer="SoftwareCollections.org " 39 | 40 | EXPOSE 3306 41 | 42 | # This image must forever use UID 27 for mysql user so our volumes are 43 | # safe in the future. This should *never* change, the last test is there 44 | # to make sure of that. 45 | RUN yum -y module disable ${NAME} && \ 46 | INSTALL_PKGS="policycoreutils rsync tar gettext hostname bind-utils groff-base ${NAME}-server" && \ 47 | yum install -y --setopt=tsflags=nodocs ${INSTALL_PKGS} && \ 48 | rpm -V ${INSTALL_PKGS} && \ 49 | /usr/libexec/mysqld -V | grep -qe "${MYSQL_VERSION}\." && echo "Found VERSION ${MYSQL_VERSION}" && \ 50 | yum -y clean all --enablerepo='*' && \ 51 | mkdir -p ${HOME}/data && chown -R mysql.0 ${HOME} && \ 52 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 53 | 54 | # Get prefix path and path to scripts rather than hard-code them in scripts 55 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 56 | MYSQL_PREFIX=/usr 57 | 58 | COPY ${MYSQL_VERSION}/root-common / 59 | COPY ${MYSQL_VERSION}/s2i-common/bin/ ${STI_SCRIPTS_PATH} 60 | COPY ${MYSQL_VERSION}/root / 61 | 62 | # Hard links are not supported in Testing Farm approach during sync to guest 63 | # operation system. Therefore tests are failing on error 64 | # /usr/libexec/s2i/run no such file or directory 65 | RUN ln -s /usr/bin/run-mysqld ${STI_SCRIPTS_PATH}/run 66 | 67 | # this is needed due to issues with squash 68 | # when this directory gets rm'd by the container-setup 69 | # script. 70 | # Also reset permissions of filesystem to default values 71 | RUN rm -rf /etc/my.cnf.d/* && \ 72 | /usr/libexec/container-setup && \ 73 | rpm-file-permissions 74 | 75 | USER 27 76 | 77 | ENTRYPOINT ["container-entrypoint"] 78 | CMD ["run-mysqld"] 79 | -------------------------------------------------------------------------------- /10.5/Dockerfile.fedora: -------------------------------------------------------------------------------- 1 | FROM quay.io/fedora/s2i-core:38 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | 13 | ENV MYSQL_VERSION=10.5 \ 14 | APP_DATA=/opt/app-root/src \ 15 | HOME=/var/lib/mysql \ 16 | NAME=mariadb \ 17 | VERSION=10.5 \ 18 | ARCH=x86_64 \ 19 | SUMMARY="MariaDB 10.5 SQL database server" \ 20 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 21 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 22 | The mysqld server daemon accepts connections from clients and provides access to content from \ 23 | MariaDB databases on behalf of the clients." 24 | 25 | LABEL summary="$SUMMARY" \ 26 | description="$DESCRIPTION" \ 27 | io.k8s.description="MariaDB is a multi-user, multi-threaded SQL database server" \ 28 | io.k8s.display-name="MariaDB 10.5" \ 29 | io.openshift.expose-services="3306:mysql" \ 30 | io.openshift.tags="database,mysql,mariadb,mariadb105,galera" \ 31 | com.redhat.component="$NAME" \ 32 | name="fedora/$NAME-105" \ 33 | version="$VERSION" \ 34 | usage="docker run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 quay.io/fedora/$NAME-105" \ 35 | maintainer="SoftwareCollections.org " 36 | 37 | EXPOSE 3306 38 | 39 | # This image must forever use UID 27 for mysql user so our volumes are 40 | # safe in the future. This should *never* change, the last test is there 41 | # to make sure of that. 42 | RUN yum -y module enable mariadb:$MYSQL_VERSION && \ 43 | INSTALL_PKGS="policycoreutils rsync tar gettext hostname bind-utils groff-base mariadb-server" && \ 44 | dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 45 | rpm -V $INSTALL_PKGS && \ 46 | /usr/libexec/mysqld -V | grep -qe "$MYSQL_VERSION\." && echo "Found VERSION $MYSQL_VERSION" && \ 47 | dnf clean all && \ 48 | mkdir -p /var/lib/mysql/data && chown -R mysql.0 /var/lib/mysql && \ 49 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 50 | 51 | # Get prefix path and path to scripts rather than hard-code them in scripts 52 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 53 | MYSQL_PREFIX=/usr 54 | 55 | COPY 10.5/root-common / 56 | COPY 10.5/s2i-common/bin/ $STI_SCRIPTS_PATH 57 | COPY 10.5/root / 58 | 59 | # Hard links are not supported in Testing Farm approach during sync to guest 60 | # operation system. Therefore tests are failing on error 61 | # /usr/libexec/s2i/run no such file or directory 62 | RUN ln -s /usr/bin/run-mysqld $STI_SCRIPTS_PATH/run 63 | 64 | # this is needed due to issues with squash 65 | # when this directory gets rm'd by the container-setup 66 | # script. 67 | # Also reset permissions of filesystem to default values 68 | RUN rm -rf /etc/my.cnf.d/* && \ 69 | /usr/libexec/container-setup && \ 70 | rpm-file-permissions 71 | 72 | USER 27 73 | 74 | ENTRYPOINT ["container-entrypoint"] 75 | CMD ["run-mysqld"] 76 | -------------------------------------------------------------------------------- /10.5/Dockerfile.rhel7: -------------------------------------------------------------------------------- 1 | FROM rhscl/s2i-core-rhel7 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | 13 | ENV MYSQL_VERSION=10.5 \ 14 | APP_DATA=/opt/app-root/src \ 15 | HOME=/var/lib/mysql \ 16 | SUMMARY="MariaDB 10.5 SQL database server" \ 17 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 18 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 19 | The mysqld server daemon accepts connections from clients and provides access to content from \ 20 | MariaDB databases on behalf of the clients." 21 | 22 | LABEL summary="$SUMMARY" \ 23 | description="$DESCRIPTION" \ 24 | io.k8s.description="$DESCRIPTION" \ 25 | io.k8s.display-name="MariaDB 10.5" \ 26 | io.openshift.expose-services="3306:mysql" \ 27 | io.openshift.tags="database,mysql,mariadb,mariadb105,rh-mariadb105" \ 28 | com.redhat.component="rh-mariadb105-container" \ 29 | name="rhscl/mariadb-105-rhel7" \ 30 | version="1" \ 31 | com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \ 32 | usage="docker run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 rhscl/mariadb-105-rhel7" \ 33 | maintainer="SoftwareCollections.org " 34 | 35 | EXPOSE 3306 36 | 37 | # This image must forever use UID 27 for mysql user so our volumes are 38 | # safe in the future. This should *never* change, the last test is there 39 | # to make sure of that. 40 | RUN yum install -y yum-utils && \ 41 | prepare-yum-repositories rhel-server-rhscl-7-rpms && \ 42 | INSTALL_PKGS="rsync tar gettext hostname bind-utils groff-base rh-mariadb105 rh-mariadb105-mariadb-server-utils rh-mariadb105-mariadb-syspaths" && \ 43 | yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 44 | rpm -V $INSTALL_PKGS && \ 45 | yum -y clean all --enablerepo='*' && \ 46 | mkdir -p /var/lib/mysql/data && chown -R mysql.0 /var/lib/mysql && \ 47 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 48 | 49 | # Get prefix path and path to scripts rather than hard-code them in scripts 50 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 51 | MYSQL_PREFIX=/opt/rh/rh-mariadb105/root/usr \ 52 | ENABLED_COLLECTIONS=rh-mariadb105 53 | 54 | # When bash is started non-interactively, to run a shell script, for example it 55 | # looks for this variable and source the content of this file. This will enable 56 | # the SCL for all scripts without need to do 'scl enable'. 57 | ENV BASH_ENV=${CONTAINER_SCRIPTS_PATH}/scl_enable \ 58 | ENV=${CONTAINER_SCRIPTS_PATH}/scl_enable \ 59 | PROMPT_COMMAND=". ${CONTAINER_SCRIPTS_PATH}/scl_enable" 60 | 61 | COPY 10.5/root-common / 62 | COPY 10.5/s2i-common/bin/ $STI_SCRIPTS_PATH 63 | COPY 10.5/root / 64 | 65 | # Hard links are not supported in Testing Farm approach during sync to guest 66 | # operation system. Therefore tests are failing on error 67 | # /usr/libexec/s2i/run no such file or directory 68 | RUN ln -s /usr/bin/run-mysqld $STI_SCRIPTS_PATH/run 69 | 70 | # this is needed due to issues with squash 71 | # when this directory gets rm'd by the container-setup 72 | # script. 73 | # Also reset permissions of filesystem to default values 74 | RUN rm -rf /etc/my.cnf.d/* && \ 75 | /usr/libexec/container-setup && \ 76 | rpm-file-permissions 77 | 78 | USER 27 79 | 80 | ENTRYPOINT ["container-entrypoint"] 81 | CMD ["run-mysqld"] 82 | -------------------------------------------------------------------------------- /10.5/Dockerfile.rhel8: -------------------------------------------------------------------------------- 1 | FROM ubi8/s2i-core 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | 13 | ENV MYSQL_VERSION=10.5 \ 14 | APP_DATA=/opt/app-root/src \ 15 | HOME=/var/lib/mysql \ 16 | SUMMARY="MariaDB 10.5 SQL database server" \ 17 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 18 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 19 | The mysqld server daemon accepts connections from clients and provides access to content from \ 20 | MariaDB databases on behalf of the clients." 21 | 22 | LABEL summary="$SUMMARY" \ 23 | description="$DESCRIPTION" \ 24 | io.k8s.description="$DESCRIPTION" \ 25 | io.k8s.display-name="MariaDB 10.5" \ 26 | io.openshift.expose-services="3306:mysql" \ 27 | io.openshift.tags="database,mysql,mariadb,mariadb105,mariadb-105" \ 28 | com.redhat.component="mariadb-105-container" \ 29 | name="rhel8/mariadb-105" \ 30 | version="1" \ 31 | usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 rhel8/mariadb-105" \ 32 | maintainer="SoftwareCollections.org " 33 | 34 | EXPOSE 3306 35 | 36 | # This image must forever use UID 27 for mysql user so our volumes are 37 | # safe in the future. This should *never* change, the last test is there 38 | # to make sure of that. 39 | RUN yum -y module enable mariadb:$MYSQL_VERSION && \ 40 | INSTALL_PKGS="policycoreutils rsync tar gettext hostname bind-utils groff-base mariadb-server" && \ 41 | yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ 42 | rpm -V $INSTALL_PKGS && \ 43 | /usr/libexec/mysqld -V | grep -qe "$MYSQL_VERSION\." && echo "Found VERSION $MYSQL_VERSION" && \ 44 | yum -y clean all --enablerepo='*' && \ 45 | mkdir -p /var/lib/mysql/data && chown -R mysql.0 /var/lib/mysql && \ 46 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 47 | 48 | # Get prefix path and path to scripts rather than hard-code them in scripts 49 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 50 | MYSQL_PREFIX=/usr 51 | 52 | COPY 10.5/root-common / 53 | COPY 10.5/s2i-common/bin/ $STI_SCRIPTS_PATH 54 | COPY 10.5/root / 55 | 56 | # Hard links are not supported in Testing Farm approach during sync to guest 57 | # operation system. Therefore tests are failing on error 58 | # /usr/libexec/s2i/run no such file or directory 59 | RUN ln -s /usr/bin/run-mysqld $STI_SCRIPTS_PATH/run 60 | 61 | # this is needed due to issues with squash 62 | # when this directory gets rm'd by the container-setup 63 | # script. 64 | # Also reset permissions of filesystem to default values 65 | RUN rm -rf /etc/my.cnf.d/* && \ 66 | /usr/libexec/container-setup && \ 67 | rpm-file-permissions 68 | 69 | USER 27 70 | 71 | ENTRYPOINT ["container-entrypoint"] 72 | CMD ["run-mysqld"] 73 | -------------------------------------------------------------------------------- /10.5/Dockerfile.rhel9: -------------------------------------------------------------------------------- 1 | FROM ubi9/s2i-core 2 | 3 | # MariaDB image for OpenShift. 4 | # 5 | # Volumes: 6 | # * /var/lib/mysql/data - Datastore for MariaDB 7 | # Environment: 8 | # * $MYSQL_USER - Database user name 9 | # * $MYSQL_PASSWORD - User's password 10 | # * $MYSQL_DATABASE - Name of the database to create 11 | # * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account 12 | 13 | # Standalone ENV call so these values can be re-used in the other ENV calls 14 | ENV MYSQL_VERSION=10.5 \ 15 | MYSQL_SHORT_VERSION=105 16 | 17 | ENV VERSION="${MYSQL_VERSION}" \ 18 | APP_DATA=/opt/app-root/src \ 19 | HOME=/var/lib/mysql \ 20 | NAME=mariadb \ 21 | SUMMARY="MariaDB ${MYSQL_VERSION} SQL database server" \ 22 | DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ 23 | image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ 24 | The mysqld server daemon accepts connections from clients and provides access to content from \ 25 | MariaDB databases on behalf of the clients." 26 | 27 | LABEL summary="${SUMMARY}" \ 28 | description="${DESCRIPTION}" \ 29 | io.k8s.description="${DESCRIPTION}" \ 30 | io.k8s.display-name="MariaDB ${MYSQL_VERSION}" \ 31 | io.openshift.expose-services="3306:mysql" \ 32 | io.openshift.tags="database,mysql,${NAME},${NAME}${MYSQL_SHORT_VERSION},${NAME}-${MYSQL_SHORT_VERSION}" \ 33 | com.redhat.component="${NAME}-${MYSQL_SHORT_VERSION}-container" \ 34 | name="rhel9/${NAME}-${MYSQL_SHORT_VERSION}" \ 35 | version="1" \ 36 | com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \ 37 | usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 rhel9/${NAME}-${MYSQL_SHORT_VERSION}" \ 38 | maintainer="SoftwareCollections.org " 39 | 40 | EXPOSE 3306 41 | 42 | # This image must forever use UID 27 for mysql user so our volumes are 43 | # safe in the future. This should *never* change, the last test is there 44 | # to make sure of that. 45 | RUN INSTALL_PKGS="policycoreutils rsync tar gettext hostname bind9.18-utils groff-base ${NAME}-server" && \ 46 | yum install -y --setopt=tsflags=nodocs ${INSTALL_PKGS} && \ 47 | rpm -V ${INSTALL_PKGS} && \ 48 | /usr/libexec/mysqld -V | grep -qe "${MYSQL_VERSION}\." && echo "Found VERSION ${MYSQL_VERSION}" && \ 49 | yum -y clean all --enablerepo='*' && \ 50 | mkdir -p ${HOME}/data && chown -R mysql.0 ${HOME} && \ 51 | test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" 52 | 53 | # Get prefix path and path to scripts rather than hard-code them in scripts 54 | ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ 55 | MYSQL_PREFIX=/usr 56 | 57 | COPY ${MYSQL_VERSION}/root-common / 58 | COPY ${MYSQL_VERSION}/s2i-common/bin/ ${STI_SCRIPTS_PATH} 59 | COPY ${MYSQL_VERSION}/root / 60 | 61 | # Hard links are not supported in Testing Farm approach during sync to guest 62 | # operation system. Therefore tests are failing on error 63 | # /usr/libexec/s2i/run no such file or directory 64 | RUN ln -s /usr/bin/run-mysqld ${STI_SCRIPTS_PATH}/run 65 | 66 | # this is needed due to issues with squash 67 | # when this directory gets rm'd by the container-setup 68 | # script. 69 | # Also reset permissions of filesystem to default values 70 | RUN rm -rf /etc/my.cnf.d/* && \ 71 | /usr/libexec/container-setup && \ 72 | rpm-file-permissions 73 | 74 | USER 27 75 | 76 | ENTRYPOINT ["container-entrypoint"] 77 | CMD ["run-mysqld"] 78 | -------------------------------------------------------------------------------- /10.5/README.md: -------------------------------------------------------------------------------- 1 | root/usr/share/container-scripts/mysql/README.md -------------------------------------------------------------------------------- /10.5/root-common: -------------------------------------------------------------------------------- 1 | ../root-common -------------------------------------------------------------------------------- /10.5/s2i-common: -------------------------------------------------------------------------------- 1 | ../s2i-common -------------------------------------------------------------------------------- /10.5/test: -------------------------------------------------------------------------------- 1 | ../test -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Variables are documented in hack/build.sh. 2 | BASE_IMAGE_NAME = mariadb 3 | VERSIONS = 10.3 10.5 10.11 4 | OPENSHIFT_NAMESPACES = 5 | DOCKER_BUILD_CONTEXT = .. 6 | 7 | # HACK: Ensure that 'git pull' for old clones doesn't cause confusion. 8 | # New clones should use '--recursive'. 9 | .PHONY: $(shell test -f common/common.mk || echo >&2 'Please do "git submodule update --init" first.') 10 | 11 | include common/common.mk 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | MariaDB SQL Database Server Docker Image 2 | ======================================== 3 | 4 | [![Build and push images to Quay.io registry](https://github.com/sclorg/mariadb-container/actions/workflows/build-and-push.yml/badge.svg)](https://github.com/sclorg/mariadb-container/actions/workflows/build-and-push.yml) 5 | 6 | Images available on Quay are: 7 | * CentOS Stream 9 [mariadb-105](https://quay.io/repository/sclorg/mariadb-105-c9s) 8 | * CentOS Stream 9 [mariadb-1011](https://quay.io/repository/sclorg/mariadb-1011-c9s) 9 | * CentOS Stream 10 [mariadb-1011](https://quay.io/repository/sclorg/mariadb-1011-c10s) 10 | * Fedora [mariadb-103](https://quay.io/repository/fedora/mariadb-103) 11 | * Fedora [mariadb-105](https://quay.io/repository/fedora/mariadb-105) 12 | * Fedora [mariadb-1011](https://quay.io/repository/fedora/mariadb-1011) 13 | 14 | This repository contains Dockerfiles for MariaDB images for OpenShift and general usage. 15 | Users can choose between RHEL, Fedora and CentOS Stream based images. 16 | 17 | MariaDB container is very similar to the MySQL container available at 18 | [https://github.com/sclorg/mysql-container](https://github.com/sclorg/mysql-container). 19 | 20 | For more information about using these images with OpenShift, please see the 21 | official [OpenShift Documentation](https://docs.okd.io/latest/using_images/db_images/mariadb.html). 22 | 23 | For more information about contributing, see 24 | [the Contribution Guidelines](https://github.com/sclorg/welcome/blob/master/contribution.md). 25 | For more information about concepts used in these podman images, see the 26 | [Landing page](https://github.com/sclorg/welcome). 27 | 28 | 29 | Versions 30 | --------------- 31 | MariaDB versions currently provided are: 32 | * [MariaDB 10.3](10.3) 33 | * [MariaDB 10.5](10.5) 34 | * [MariaDB 10.11](10.11) 35 | 36 | RHEL versions currently supported are: 37 | * RHEL8 38 | * RHEL9 39 | * RHEL10 40 | 41 | CentOS versions currently supported are: 42 | * CentOS Stream 9 43 | * CentOS Stream 10 44 | 45 | 46 | Installation 47 | ---------------------- 48 | 49 | * **RHEL8 based image** 50 | 51 | These images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/#/registry.access.redhat.com/rhel8/mariadb-105). 52 | To download it run: 53 | 54 | ``` 55 | $ podman pull registry.access.redhat.com/rhel8/mariadb-105 56 | ``` 57 | 58 | To build a RHEL8 based MariaDB image, you need to run Docker build on a properly 59 | subscribed RHEL machine. 60 | 61 | ``` 62 | $ git clone --recursive https://github.com/sclorg/mariadb-container.git 63 | $ cd mariadb-container 64 | $ git submodule update --init 65 | $ make build TARGET=rhel8 VERSIONS=10.5 66 | ``` 67 | 68 | For using other versions of MariaDB, just replace the `10.5` value by particular version 69 | in the commands above. 70 | 71 | Note: while the installation steps are calling `podman`, you can replace any such calls by `docker` with the same arguments. 72 | 73 | **Notice: By omitting the `VERSIONS` parameter, the build/test action will be performed 74 | on all provided versions of MariaDB, which must be specified in `VERSIONS` variable. 75 | This variable must be set to a list with possible versions (subdirectories).** 76 | 77 | 78 | Usage 79 | --------------------------------- 80 | 81 | For information about usage of Dockerfile for MariaDB 10.3, 82 | see [usage documentation](10.3). 83 | 84 | For information about usage of Dockerfile for MariaDB 10.5, 85 | see [usage documentation](10.5). 86 | 87 | For information about usage of Dockerfile for MariaDB 10.11, 88 | see [usage documentation](10.11). 89 | 90 | Test 91 | --------------------------------- 92 | 93 | This repository also provides a test framework, which checks basic functionality 94 | of the MariaDB image. 95 | 96 | Users can choose between testing MariaDB based on a RHEL or CentOS image. 97 | 98 | * **RHEL based image** 99 | 100 | To test a RHEL8 based MariaDB image, you need to run the test on a properly 101 | subscribed RHEL machine. 102 | 103 | ``` 104 | $ cd mariadb-container 105 | $ git submodule update --init 106 | $ make test TARGET=rhel8 VERSIONS=10.5 107 | ``` 108 | 109 | For using other versions of MariaDB, just replace the `10.5` value by particular version 110 | in the commands above. 111 | 112 | **Notice: By omitting the `VERSIONS` parameter, the build/test action will be performed 113 | on all provided versions of MariaDB, which must be specified in `VERSIONS` variable. 114 | This variable must be set to a list with possible versions (subdirectories).** 115 | -------------------------------------------------------------------------------- /examples/extend-image/mysql-cfg/myconfig.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | query-cache-limit=262144 3 | 4 | -------------------------------------------------------------------------------- /examples/extend-image/mysql-data/init.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE products (id INTEGER, name VARCHAR(256), price FLOAT, variant INTEGER); 2 | CREATE TABLE products_variant (id INTEGER, name VARCHAR(256)); 3 | INSERT INTO products_variant (id, name) VALUES ('1', 'blue'), ('2', 'green'); 4 | 5 | -------------------------------------------------------------------------------- /examples/extend-image/mysql-init/80-add-arbitrary-users.sh: -------------------------------------------------------------------------------- 1 | create_arbitrary_users() { 2 | # Do not care what option is compulsory here, just create what is specified 3 | log_info "Creating user specified by MYSQL_OPERATIONS_USER (${MYSQL_OPERATIONS_USER}) ..." 4 | mysql $mysql_flags <- 7 | Provides a MariaDB APP_VERSION database on DISTRO_NAME. For more information 8 | about using this database image, including OpenShift considerations, see 9 | https://github.com/sclorg/mariadb-container/tree/master/APP_VERSION/README.md. 10 | imagestream_files: 11 | - filename: mariadb-centos.json 12 | latest: "10.11-el9" 13 | distros: 14 | - name: CentOS Stream 9 15 | app_versions: ["10.5", "10.11"] 16 | 17 | - name: CentOS Stream 10 18 | app_versions: ["10.11"] 19 | 20 | - filename: mariadb-rhel.json 21 | latest: "10.11-el9" 22 | distros: 23 | - name: RHEL 8 24 | app_versions: ["10.3", "10.5", "10.11"] 25 | 26 | - name: RHEL 9 27 | app_versions: ["10.5", "10.11"] 28 | 29 | - name: RHEL 10 30 | app_versions: ["10.11"] 31 | 32 | - filename: mariadb-rhel-aarch64.json 33 | latest: "10.11-el9" 34 | distros: 35 | - name: RHEL 8 36 | app_versions: ["10.3", "10.5", "10.11" ] 37 | 38 | - name: RHEL 9 39 | app_versions: ["10.5", "10.11"] 40 | 41 | - name: RHEL 10 42 | app_versions: ["10.11"] 43 | -------------------------------------------------------------------------------- /imagestreams/mariadb-centos.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "ImageStream", 3 | "apiVersion": "image.openshift.io/v1", 4 | "metadata": { 5 | "name": "mariadb", 6 | "annotations": { 7 | "openshift.io/display-name": "MariaDB" 8 | } 9 | }, 10 | "spec": { 11 | "tags": [ 12 | { 13 | "name": "10.5-el9", 14 | "annotations": { 15 | "openshift.io/display-name": "MariaDB 10.5 (CentOS Stream 9)", 16 | "openshift.io/provider-display-name": "Red Hat, Inc.", 17 | "description": "Provides a MariaDB 10.5 database on CentOS Stream 9. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.5/README.md.", 18 | "iconClass": "icon-mariadb", 19 | "tags": "database,mariadb", 20 | "version": "10.5" 21 | }, 22 | "from": { 23 | "kind": "DockerImage", 24 | "name": "quay.io/sclorg/mariadb-105-c9s:latest" 25 | }, 26 | "referencePolicy": { 27 | "type": "Local" 28 | } 29 | }, 30 | { 31 | "name": "10.11-el9", 32 | "annotations": { 33 | "openshift.io/display-name": "MariaDB 10.11 (CentOS Stream 9)", 34 | "openshift.io/provider-display-name": "Red Hat, Inc.", 35 | "description": "Provides a MariaDB 10.11 database on CentOS Stream 9. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.11/README.md.", 36 | "iconClass": "icon-mariadb", 37 | "tags": "database,mariadb", 38 | "version": "10.11" 39 | }, 40 | "from": { 41 | "kind": "DockerImage", 42 | "name": "quay.io/sclorg/mariadb-1011-c9s:latest" 43 | }, 44 | "referencePolicy": { 45 | "type": "Local" 46 | } 47 | }, 48 | { 49 | "name": "10.11-el10", 50 | "annotations": { 51 | "openshift.io/display-name": "MariaDB 10.11 (CentOS Stream 10)", 52 | "openshift.io/provider-display-name": "Red Hat, Inc.", 53 | "description": "Provides a MariaDB 10.11 database on CentOS Stream 10. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.11/README.md.", 54 | "iconClass": "icon-mariadb", 55 | "tags": "database,mariadb", 56 | "version": "10.11" 57 | }, 58 | "from": { 59 | "kind": "DockerImage", 60 | "name": "quay.io/sclorg/mariadb-1011-c10s:latest" 61 | }, 62 | "referencePolicy": { 63 | "type": "Local" 64 | } 65 | }, 66 | { 67 | "name": "latest", 68 | "annotations": { 69 | "openshift.io/display-name": "MariaDB 10.11 (Latest)", 70 | "openshift.io/provider-display-name": "Red Hat, Inc.", 71 | "description": "Provides a MariaDB 10.11 database on CentOS Stream 9. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.11/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", 72 | "iconClass": "icon-mariadb", 73 | "tags": "database,mariadb", 74 | "version": "10.11" 75 | }, 76 | "from": { 77 | "kind": "ImageStreamTag", 78 | "name": "10.11-el9" 79 | }, 80 | "referencePolicy": { 81 | "type": "Local" 82 | } 83 | } 84 | ] 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /imagestreams/mariadb-rhel-aarch64.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "ImageStream", 3 | "apiVersion": "image.openshift.io/v1", 4 | "metadata": { 5 | "name": "mariadb", 6 | "annotations": { 7 | "openshift.io/display-name": "MariaDB" 8 | } 9 | }, 10 | "spec": { 11 | "tags": [ 12 | { 13 | "name": "10.3-el8", 14 | "annotations": { 15 | "openshift.io/display-name": "MariaDB 10.3 (RHEL 8)", 16 | "openshift.io/provider-display-name": "Red Hat, Inc.", 17 | "description": "Provides a MariaDB 10.3 database on RHEL 8. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.3/README.md.", 18 | "iconClass": "icon-mariadb", 19 | "tags": "database,mariadb", 20 | "version": "10.3" 21 | }, 22 | "from": { 23 | "kind": "DockerImage", 24 | "name": "registry.redhat.io/rhel8/mariadb-103:latest" 25 | }, 26 | "referencePolicy": { 27 | "type": "Local" 28 | } 29 | }, 30 | { 31 | "name": "10.5-el8", 32 | "annotations": { 33 | "openshift.io/display-name": "MariaDB 10.5 (RHEL 8)", 34 | "openshift.io/provider-display-name": "Red Hat, Inc.", 35 | "description": "Provides a MariaDB 10.5 database on RHEL 8. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.5/README.md.", 36 | "iconClass": "icon-mariadb", 37 | "tags": "database,mariadb", 38 | "version": "10.5" 39 | }, 40 | "from": { 41 | "kind": "DockerImage", 42 | "name": "registry.redhat.io/rhel8/mariadb-105:latest" 43 | }, 44 | "referencePolicy": { 45 | "type": "Local" 46 | } 47 | }, 48 | { 49 | "name": "10.11-el8", 50 | "annotations": { 51 | "openshift.io/display-name": "MariaDB 10.11 (RHEL 8)", 52 | "openshift.io/provider-display-name": "Red Hat, Inc.", 53 | "description": "Provides a MariaDB 10.11 database on RHEL 8. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.11/README.md.", 54 | "iconClass": "icon-mariadb", 55 | "tags": "database,mariadb", 56 | "version": "10.11" 57 | }, 58 | "from": { 59 | "kind": "DockerImage", 60 | "name": "registry.redhat.io/rhel8/mariadb-1011:latest" 61 | }, 62 | "referencePolicy": { 63 | "type": "Local" 64 | } 65 | }, 66 | { 67 | "name": "10.5-el9", 68 | "annotations": { 69 | "openshift.io/display-name": "MariaDB 10.5 (RHEL 9)", 70 | "openshift.io/provider-display-name": "Red Hat, Inc.", 71 | "description": "Provides a MariaDB 10.5 database on RHEL 9. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.5/README.md.", 72 | "iconClass": "icon-mariadb", 73 | "tags": "database,mariadb", 74 | "version": "10.5" 75 | }, 76 | "from": { 77 | "kind": "DockerImage", 78 | "name": "registry.redhat.io/rhel9/mariadb-105:latest" 79 | }, 80 | "referencePolicy": { 81 | "type": "Local" 82 | } 83 | }, 84 | { 85 | "name": "10.11-el9", 86 | "annotations": { 87 | "openshift.io/display-name": "MariaDB 10.11 (RHEL 9)", 88 | "openshift.io/provider-display-name": "Red Hat, Inc.", 89 | "description": "Provides a MariaDB 10.11 database on RHEL 9. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.11/README.md.", 90 | "iconClass": "icon-mariadb", 91 | "tags": "database,mariadb", 92 | "version": "10.11" 93 | }, 94 | "from": { 95 | "kind": "DockerImage", 96 | "name": "registry.redhat.io/rhel9/mariadb-1011:latest" 97 | }, 98 | "referencePolicy": { 99 | "type": "Local" 100 | } 101 | }, 102 | { 103 | "name": "10.11-el10", 104 | "annotations": { 105 | "openshift.io/display-name": "MariaDB 10.11 (RHEL 10)", 106 | "openshift.io/provider-display-name": "Red Hat, Inc.", 107 | "description": "Provides a MariaDB 10.11 database on RHEL 10. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.11/README.md.", 108 | "iconClass": "icon-mariadb", 109 | "tags": "database,mariadb", 110 | "version": "10.11" 111 | }, 112 | "from": { 113 | "kind": "DockerImage", 114 | "name": "registry.redhat.io/rhel10/mariadb-1011:latest" 115 | }, 116 | "referencePolicy": { 117 | "type": "Local" 118 | } 119 | }, 120 | { 121 | "name": "latest", 122 | "annotations": { 123 | "openshift.io/display-name": "MariaDB 10.11 (Latest)", 124 | "openshift.io/provider-display-name": "Red Hat, Inc.", 125 | "description": "Provides a MariaDB 10.11 database on RHEL 9. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.11/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", 126 | "iconClass": "icon-mariadb", 127 | "tags": "database,mariadb", 128 | "version": "10.11" 129 | }, 130 | "from": { 131 | "kind": "ImageStreamTag", 132 | "name": "10.11-el9" 133 | }, 134 | "referencePolicy": { 135 | "type": "Local" 136 | } 137 | } 138 | ] 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /imagestreams/mariadb-rhel.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "ImageStream", 3 | "apiVersion": "image.openshift.io/v1", 4 | "metadata": { 5 | "name": "mariadb", 6 | "annotations": { 7 | "openshift.io/display-name": "MariaDB" 8 | } 9 | }, 10 | "spec": { 11 | "tags": [ 12 | { 13 | "name": "10.3-el8", 14 | "annotations": { 15 | "openshift.io/display-name": "MariaDB 10.3 (RHEL 8)", 16 | "openshift.io/provider-display-name": "Red Hat, Inc.", 17 | "description": "Provides a MariaDB 10.3 database on RHEL 8. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.3/README.md.", 18 | "iconClass": "icon-mariadb", 19 | "tags": "database,mariadb", 20 | "version": "10.3" 21 | }, 22 | "from": { 23 | "kind": "DockerImage", 24 | "name": "registry.redhat.io/rhel8/mariadb-103:latest" 25 | }, 26 | "referencePolicy": { 27 | "type": "Local" 28 | } 29 | }, 30 | { 31 | "name": "10.5-el8", 32 | "annotations": { 33 | "openshift.io/display-name": "MariaDB 10.5 (RHEL 8)", 34 | "openshift.io/provider-display-name": "Red Hat, Inc.", 35 | "description": "Provides a MariaDB 10.5 database on RHEL 8. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.5/README.md.", 36 | "iconClass": "icon-mariadb", 37 | "tags": "database,mariadb", 38 | "version": "10.5" 39 | }, 40 | "from": { 41 | "kind": "DockerImage", 42 | "name": "registry.redhat.io/rhel8/mariadb-105:latest" 43 | }, 44 | "referencePolicy": { 45 | "type": "Local" 46 | } 47 | }, 48 | { 49 | "name": "10.11-el8", 50 | "annotations": { 51 | "openshift.io/display-name": "MariaDB 10.11 (RHEL 8)", 52 | "openshift.io/provider-display-name": "Red Hat, Inc.", 53 | "description": "Provides a MariaDB 10.11 database on RHEL 8. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.11/README.md.", 54 | "iconClass": "icon-mariadb", 55 | "tags": "database,mariadb", 56 | "version": "10.11" 57 | }, 58 | "from": { 59 | "kind": "DockerImage", 60 | "name": "registry.redhat.io/rhel8/mariadb-1011:latest" 61 | }, 62 | "referencePolicy": { 63 | "type": "Local" 64 | } 65 | }, 66 | { 67 | "name": "10.5-el9", 68 | "annotations": { 69 | "openshift.io/display-name": "MariaDB 10.5 (RHEL 9)", 70 | "openshift.io/provider-display-name": "Red Hat, Inc.", 71 | "description": "Provides a MariaDB 10.5 database on RHEL 9. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.5/README.md.", 72 | "iconClass": "icon-mariadb", 73 | "tags": "database,mariadb", 74 | "version": "10.5" 75 | }, 76 | "from": { 77 | "kind": "DockerImage", 78 | "name": "registry.redhat.io/rhel9/mariadb-105:latest" 79 | }, 80 | "referencePolicy": { 81 | "type": "Local" 82 | } 83 | }, 84 | { 85 | "name": "10.11-el9", 86 | "annotations": { 87 | "openshift.io/display-name": "MariaDB 10.11 (RHEL 9)", 88 | "openshift.io/provider-display-name": "Red Hat, Inc.", 89 | "description": "Provides a MariaDB 10.11 database on RHEL 9. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.11/README.md.", 90 | "iconClass": "icon-mariadb", 91 | "tags": "database,mariadb", 92 | "version": "10.11" 93 | }, 94 | "from": { 95 | "kind": "DockerImage", 96 | "name": "registry.redhat.io/rhel9/mariadb-1011:latest" 97 | }, 98 | "referencePolicy": { 99 | "type": "Local" 100 | } 101 | }, 102 | { 103 | "name": "10.11-el10", 104 | "annotations": { 105 | "openshift.io/display-name": "MariaDB 10.11 (RHEL 10)", 106 | "openshift.io/provider-display-name": "Red Hat, Inc.", 107 | "description": "Provides a MariaDB 10.11 database on RHEL 10. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.11/README.md.", 108 | "iconClass": "icon-mariadb", 109 | "tags": "database,mariadb", 110 | "version": "10.11" 111 | }, 112 | "from": { 113 | "kind": "DockerImage", 114 | "name": "registry.redhat.io/rhel10/mariadb-1011:latest" 115 | }, 116 | "referencePolicy": { 117 | "type": "Local" 118 | } 119 | }, 120 | { 121 | "name": "latest", 122 | "annotations": { 123 | "openshift.io/display-name": "MariaDB 10.11 (Latest)", 124 | "openshift.io/provider-display-name": "Red Hat, Inc.", 125 | "description": "Provides a MariaDB 10.11 database on RHEL 9. For more information about using this database image, including OpenShift considerations, see https://github.com/sclorg/mariadb-container/tree/master/10.11/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", 126 | "iconClass": "icon-mariadb", 127 | "tags": "database,mariadb", 128 | "version": "10.11" 129 | }, 130 | "from": { 131 | "kind": "ImageStreamTag", 132 | "name": "10.11-el9" 133 | }, 134 | "referencePolicy": { 135 | "type": "Local" 136 | } 137 | } 138 | ] 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /root-common/etc/my.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | 3 | # Disabling symbolic-links is recommended to prevent assorted security risks 4 | symbolic-links = 0 5 | 6 | # http://www.percona.com/blog/2008/05/31/dns-achilles-heel-mysql-installation/ 7 | skip_name_resolve 8 | 9 | # http://www.chriscalender.com/ignoring-the-lostfound-directory-in-your-datadir/ 10 | ignore-db-dirs=lost+found 11 | 12 | # GlusterFS equivalent of 'lost+found' 13 | ignore-db-dirs=.trashcan 14 | 15 | # NetApp snapshot dir 16 | ignore-db-dirs=.snapshot 17 | 18 | !includedir /etc/my.cnf.d 19 | -------------------------------------------------------------------------------- /root-common/usr/bin/container-entrypoint: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | exec "$@" 3 | -------------------------------------------------------------------------------- /root-common/usr/bin/mysqld-master: -------------------------------------------------------------------------------- 1 | run-mysqld-master -------------------------------------------------------------------------------- /root-common/usr/bin/mysqld-slave: -------------------------------------------------------------------------------- 1 | run-mysqld-slave -------------------------------------------------------------------------------- /root-common/usr/bin/run-mysqld: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export_vars=$(cgroup-limits); export $export_vars 4 | source ${CONTAINER_SCRIPTS_PATH}/common.sh 5 | set -eu 6 | if [[ -v DEBUG_IGNORE_SCRIPT_FAILURES ]]; then 7 | set +e 8 | fi 9 | 10 | export_setting_variables 11 | 12 | log_volume_info $MYSQL_DATADIR 13 | 14 | # pre-init files 15 | process_extending_files ${APP_DATA}/mysql-pre-init/ ${CONTAINER_SCRIPTS_PATH}/pre-init/ 16 | 17 | if [ ! -d "$MYSQL_DATADIR/mysql" ]; then 18 | initialize_database "$@" 19 | else 20 | start_local_mysql "$@" 21 | fi 22 | 23 | # init files 24 | process_extending_files ${APP_DATA}/mysql-init/ ${CONTAINER_SCRIPTS_PATH}/init/ 25 | 26 | # Restart the MySQL server with public IP bindings 27 | shutdown_local_mysql 28 | unset_env_vars 29 | log_volume_info $MYSQL_DATADIR 30 | log_info 'Running final exec -- Only MySQL server logs after this point' 31 | exec ${MYSQL_PREFIX}/libexec/mysqld --defaults-file=$MYSQL_DEFAULTS_FILE "$@" 2>&1 32 | -------------------------------------------------------------------------------- /root-common/usr/bin/run-mysqld-master: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This is an entrypoint that runs the MySQL server in the 'master' mode. 4 | # 5 | 6 | export_vars=$(cgroup-limits); export $export_vars 7 | source ${CONTAINER_SCRIPTS_PATH}/common.sh 8 | set -eu 9 | if [[ -v DEBUG_IGNORE_SCRIPT_FAILURES ]]; then 10 | set +e 11 | fi 12 | 13 | export_setting_variables 14 | 15 | log_volume_info $MYSQL_DATADIR 16 | 17 | export MYSQL_RUNNING_AS_MASTER=1 18 | 19 | # The 'server-id' for master needs to be constant 20 | export MYSQL_SERVER_ID=1 21 | log_info "The 'master' server-id is ${MYSQL_SERVER_ID}" 22 | 23 | # pre-init files 24 | process_extending_files ${APP_DATA}/mysql-pre-init/ ${CONTAINER_SCRIPTS_PATH}/pre-init/ 25 | 26 | if [ ! -d "$MYSQL_DATADIR/mysql" ]; then 27 | initialize_database "$@" 28 | else 29 | start_local_mysql "$@" 30 | fi 31 | 32 | log_info 'Setting passwords ...' 33 | [ -f ${CONTAINER_SCRIPTS_PATH}/passwd-change.sh ] && source ${CONTAINER_SCRIPTS_PATH}/passwd-change.sh 34 | 35 | # Setup the 'master' replication on the MySQL server 36 | mysql $mysql_flags <&1 51 | -------------------------------------------------------------------------------- /root-common/usr/bin/run-mysqld-slave: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This is an entrypoint that runs the MySQL server in the 'slave' mode. 4 | # 5 | 6 | export_vars=$(cgroup-limits); export $export_vars 7 | source ${CONTAINER_SCRIPTS_PATH}/common.sh 8 | set -eu 9 | if [[ -v DEBUG_IGNORE_SCRIPT_FAILURES ]]; then 10 | set +e 11 | fi 12 | 13 | export_setting_variables 14 | 15 | log_volume_info $MYSQL_DATADIR 16 | 17 | export MYSQL_RUNNING_AS_SLAVE=1 18 | 19 | # Generate the unique 'server-id' for this master 20 | export MYSQL_SERVER_ID=$(server_id) 21 | log_info "The 'slave' server-id is ${MYSQL_SERVER_ID}" 22 | 23 | # pre-init files 24 | process_extending_files ${APP_DATA}/mysql-pre-init/ ${CONTAINER_SCRIPTS_PATH}/pre-init/ 25 | 26 | if [ ! -e "${MYSQL_DATADIR}/mysql" ]; then 27 | # Initialize MySQL database and wait for the MySQL master to accept 28 | # connections. 29 | initialize_database "$@" 30 | wait_for_mysql_master 31 | 32 | # Get binlog file and position from master 33 | STATUS_INFO=$(mysql --host "$MYSQL_MASTER_SERVICE_NAME" "-u${MYSQL_MASTER_USER}" "-p${MYSQL_MASTER_PASSWORD}" replication -e 'SELECT gtid from replication limit 1\G') 34 | GTID_VALUE=$(echo "$STATUS_INFO" | grep 'gtid:' | head -n 1 | sed -e 's/^\s*gtid: //') 35 | 36 | # checking STATUS_INFO here because empty GTID_VALUE is valid value 37 | if [ -z "${STATUS_INFO}" ] ; then 38 | echo "Could not read GTID value from master" 39 | exit 1 40 | fi 41 | 42 | mysql $mysql_flags <&1 61 | -------------------------------------------------------------------------------- /root-common/usr/bin/usage: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cat /usr/share/container-scripts/mysql/README.md 4 | 5 | -------------------------------------------------------------------------------- /root-common/usr/libexec/container-setup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This function returns all config files that daemon uses and their path 4 | # includes /opt. It is used to get correct path to the config file. 5 | mysql_get_config_files_scl() { 6 | scl enable ${ENABLED_COLLECTIONS} -- my_print_defaults --help --verbose | \ 7 | grep --after=1 '^Default options' | \ 8 | tail -n 1 | \ 9 | grep -o '[^ ]*opt[^ ]*my.cnf' 10 | } 11 | 12 | # This function picks the main config file that deamon uses and we ship in rpm 13 | mysql_get_correct_config() { 14 | # we use the same config in non-SCL packages, not necessary to guess 15 | [ -z "${ENABLED_COLLECTIONS}" ] && echo -n "/etc/my.cnf" && return 16 | 17 | # from all config files read by daemon, pick the first that exists 18 | for f in `mysql_get_config_files_scl` ; do 19 | [ -f "$f" ] && echo "$f" 20 | done | head -n 1 21 | } 22 | 23 | export MYSQL_CONFIG_FILE=$(mysql_get_correct_config) 24 | 25 | [ -z "$MYSQL_CONFIG_FILE" ] && echo "MYSQL_CONFIG_FILE is empty" && exit 1 26 | 27 | unset -f mysql_get_correct_config mysql_get_config_files_scl 28 | 29 | # we provide own config files for the container, so clean what rpm ships here 30 | mkdir -p ${MYSQL_CONFIG_FILE}.d 31 | rm -f ${MYSQL_CONFIG_FILE}.d/* 32 | 33 | # we may add options during service init, so we need to have this dir writable by daemon user 34 | chown -R mysql:0 ${MYSQL_CONFIG_FILE}.d ${MYSQL_CONFIG_FILE} 35 | restorecon -R ${MYSQL_CONFIG_FILE}.d ${MYSQL_CONFIG_FILE} 36 | 37 | # API of the container are standard paths /etc/my.cnf and /etc/my.cnf.d 38 | # we already include own /etc/my.cnf for container, but for cases the 39 | # actually used config file is not on standard path /etc/my.cnf, we 40 | # need to move it to the location daemon expects it and create symlinks 41 | if [ "$MYSQL_CONFIG_FILE" != "/etc/my.cnf" ] ; then 42 | rm -rf /etc/my.cnf.d 43 | mv /etc/my.cnf ${MYSQL_CONFIG_FILE} 44 | ln -s ${MYSQL_CONFIG_FILE} /etc/my.cnf 45 | ln -s ${MYSQL_CONFIG_FILE}.d /etc/my.cnf.d 46 | fi 47 | 48 | # setup directory for data 49 | mkdir -p /var/lib/mysql/data 50 | chown -R mysql:0 /var/lib/mysql 51 | restorecon -R /var/lib/mysql 52 | 53 | # Loosen permission bits for group to avoid problems running container with 54 | # arbitrary UID 55 | # When only specifying user, group is 0, that's why /var/lib/mysql must have 56 | # owner mysql.0; that allows to avoid a+rwx for this dir 57 | /usr/libexec/fix-permissions /var/lib/mysql ${MYSQL_CONFIG_FILE}.d ${APP_DATA}/.. 58 | usermod -a -G root mysql 59 | 60 | -------------------------------------------------------------------------------- /root-common/usr/libexec/fix-permissions: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Fix permissions on the given directory to allow group read/write of 3 | # regular files and execute of directories. 4 | find $@ -exec chown mysql:0 {} \; 5 | find $@ -exec chmod g+rw {} \; 6 | find $@ -type d -exec chmod g+x {} + 7 | -------------------------------------------------------------------------------- /root-common/usr/share/container-scripts/mysql/cnf/40-paas.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | # 3 | # Settings configured by the user 4 | # 5 | 6 | # Sets how the table names are stored and compared. Default: 0 7 | lower_case_table_names = ${MYSQL_LOWER_CASE_TABLE_NAMES} 8 | 9 | # Sets whether queries should be logged 10 | general_log = ${MYSQL_LOG_QUERIES_ENABLED} 11 | general_log_file = ${MYSQL_DATADIR}/mysql-query.log 12 | 13 | # The maximum permitted number of simultaneous client connections. Default: 151 14 | max_connections = ${MYSQL_MAX_CONNECTIONS} 15 | 16 | # The minimum/maximum lengths of the word to be included in a FULLTEXT index. Default: 4/20 17 | ft_min_word_len = ${MYSQL_FT_MIN_WORD_LEN} 18 | ft_max_word_len = ${MYSQL_FT_MAX_WORD_LEN} 19 | 20 | # In case the native AIO is broken. Default: 1 21 | # See http://help.directadmin.com/item.php?id=529 22 | innodb_use_native_aio = ${MYSQL_AIO} 23 | 24 | [myisamchk] 25 | # The minimum/maximum lengths of the word to be included in a FULLTEXT index. Default: 4/20 26 | # 27 | # To ensure that myisamchk and the server use the same values for full-text 28 | # parameters, we placed them in both sections. 29 | ft_min_word_len = ${MYSQL_FT_MIN_WORD_LEN} 30 | ft_max_word_len = ${MYSQL_FT_MAX_WORD_LEN} 31 | -------------------------------------------------------------------------------- /root-common/usr/share/container-scripts/mysql/cnf/50-my-tuning.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | key_buffer_size = ${MYSQL_KEY_BUFFER_SIZE} 3 | max_allowed_packet = ${MYSQL_MAX_ALLOWED_PACKET} 4 | table_open_cache = ${MYSQL_TABLE_OPEN_CACHE} 5 | sort_buffer_size = ${MYSQL_SORT_BUFFER_SIZE} 6 | read_buffer_size = ${MYSQL_READ_BUFFER_SIZE} 7 | read_rnd_buffer_size = 256K 8 | net_buffer_length = 2K 9 | thread_stack = 256K 10 | myisam_sort_buffer_size = 2M 11 | 12 | # It is recommended that innodb_buffer_pool_size is configured to 50 to 75 percent of system memory. 13 | innodb_buffer_pool_size = ${MYSQL_INNODB_BUFFER_POOL_SIZE} 14 | # Set .._log_file_size to 25 % of buffer pool size 15 | innodb_log_file_size = ${MYSQL_INNODB_LOG_FILE_SIZE} 16 | innodb_log_buffer_size = ${MYSQL_INNODB_LOG_BUFFER_SIZE} 17 | 18 | [mysqldump] 19 | quick 20 | max_allowed_packet = 16M 21 | 22 | [mysql] 23 | no-auto-rehash 24 | 25 | [myisamchk] 26 | key_buffer_size = 8M 27 | sort_buffer_size = 8M 28 | -------------------------------------------------------------------------------- /root-common/usr/share/container-scripts/mysql/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ${CONTAINER_SCRIPTS_PATH}/helpers.sh 4 | 5 | # Data directory where MySQL database files live. The data subdirectory is here 6 | # because .bashrc and my.cnf both live in /var/lib/mysql/ and we don't want a 7 | # volume to override it. 8 | export MYSQL_DATADIR=/var/lib/mysql/data 9 | 10 | # Configuration settings. 11 | export MYSQL_DEFAULTS_FILE=${MYSQL_DEFAULTS_FILE:-/etc/my.cnf} 12 | 13 | function export_setting_variables() { 14 | export MYSQL_BINLOG_FORMAT=${MYSQL_BINLOG_FORMAT:-STATEMENT} 15 | export MYSQL_LOWER_CASE_TABLE_NAMES=${MYSQL_LOWER_CASE_TABLE_NAMES:-0} 16 | export MYSQL_LOG_QUERIES_ENABLED=${MYSQL_LOG_QUERIES_ENABLED:-0} 17 | export MYSQL_MAX_CONNECTIONS=${MYSQL_MAX_CONNECTIONS:-151} 18 | export MYSQL_FT_MIN_WORD_LEN=${MYSQL_FT_MIN_WORD_LEN:-4} 19 | export MYSQL_FT_MAX_WORD_LEN=${MYSQL_FT_MAX_WORD_LEN:-20} 20 | export MYSQL_AIO=${MYSQL_AIO:-1} 21 | export MYSQL_MAX_ALLOWED_PACKET=${MYSQL_MAX_ALLOWED_PACKET:-200M} 22 | export MYSQL_TABLE_OPEN_CACHE=${MYSQL_TABLE_OPEN_CACHE:-400} 23 | export MYSQL_SORT_BUFFER_SIZE=${MYSQL_SORT_BUFFER_SIZE:-256K} 24 | 25 | # Export memory limit variables and calculate limits 26 | local export_vars=$(cgroup-limits) && export $export_vars || exit 1 27 | if [ -n "${NO_MEMORY_LIMIT:-}" -o -z "${MEMORY_LIMIT_IN_BYTES:-}" ]; then 28 | export MYSQL_KEY_BUFFER_SIZE=${MYSQL_KEY_BUFFER_SIZE:-32M} 29 | export MYSQL_READ_BUFFER_SIZE=${MYSQL_READ_BUFFER_SIZE:-8M} 30 | export MYSQL_INNODB_BUFFER_POOL_SIZE=${MYSQL_INNODB_BUFFER_POOL_SIZE:-32M} 31 | export MYSQL_INNODB_LOG_FILE_SIZE=${MYSQL_INNODB_LOG_FILE_SIZE:-8M} 32 | export MYSQL_INNODB_LOG_BUFFER_SIZE=${MYSQL_INNODB_LOG_BUFFER_SIZE:-8M} 33 | else 34 | export MYSQL_KEY_BUFFER_SIZE=${MYSQL_KEY_BUFFER_SIZE:-$((MEMORY_LIMIT_IN_BYTES/1024/1024/10))M} 35 | export MYSQL_READ_BUFFER_SIZE=${MYSQL_READ_BUFFER_SIZE:-$((MEMORY_LIMIT_IN_BYTES/1024/1024/20))M} 36 | export MYSQL_INNODB_BUFFER_POOL_SIZE=${MYSQL_INNODB_BUFFER_POOL_SIZE:-$((MEMORY_LIMIT_IN_BYTES/1024/1024/2))M} 37 | # We are multiplying by 15 first and dividing by 100 later so we get as much 38 | # precision as possible with whole numbers. Result is 15% of memory. 39 | export MYSQL_INNODB_LOG_FILE_SIZE=${MYSQL_INNODB_LOG_FILE_SIZE:-$((MEMORY_LIMIT_IN_BYTES*15/1024/1024/100))M} 40 | export MYSQL_INNODB_LOG_BUFFER_SIZE=${MYSQL_INNODB_LOG_BUFFER_SIZE:-$((MEMORY_LIMIT_IN_BYTES*15/1024/1024/100))M} 41 | fi 42 | export MYSQL_DATADIR_ACTION=${MYSQL_DATADIR_ACTION:-upgrade-warn} 43 | } 44 | 45 | # this stores whether the database was initialized from empty datadir 46 | export MYSQL_DATADIR_FIRST_INIT=false 47 | 48 | # Be paranoid and stricter than we should be. 49 | # https://dev.mysql.com/doc/refman/en/identifiers.html 50 | mysql_identifier_regex='^[a-zA-Z0-9_]+$' 51 | mysql_password_regex='^[a-zA-Z0-9_~!@#$%^&*()-=<>,.?;:|]+$' 52 | 53 | # Variables that are used to connect to local mysql during initialization 54 | mysql_flags="-u root --socket=/tmp/mysql.sock" 55 | admin_flags="--defaults-file=$MYSQL_DEFAULTS_FILE $mysql_flags" 56 | 57 | # Make sure env variables don't propagate to mysqld process. 58 | function unset_env_vars() { 59 | log_info 'Cleaning up environment variables MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE and MYSQL_ROOT_PASSWORD ...' 60 | unset MYSQL_USER MYSQL_PASSWORD MYSQL_DATABASE MYSQL_ROOT_PASSWORD 61 | } 62 | 63 | # Poll until MySQL responds to our ping. 64 | function wait_for_mysql() { 65 | pid=$1 ; shift 66 | 67 | while true; do 68 | if [ -d "/proc/$pid" ]; then 69 | mysqladmin $admin_flags ping &>/dev/null && log_info "MySQL started successfully" && return 0 70 | else 71 | return 1 72 | fi 73 | log_info "Waiting for MySQL to start ..." 74 | sleep 1 75 | done 76 | } 77 | 78 | # Start local MySQL server with a defaults file 79 | function start_local_mysql() { 80 | log_info 'Starting MySQL server with disabled networking ...' 81 | ${MYSQL_PREFIX}/libexec/mysqld \ 82 | --defaults-file=$MYSQL_DEFAULTS_FILE \ 83 | --skip-networking --socket=/tmp/mysql.sock "$@" & 84 | mysql_pid=$! 85 | wait_for_mysql $mysql_pid 86 | } 87 | 88 | # Shutdown mysql flushing privileges 89 | function shutdown_local_mysql() { 90 | log_info 'Shutting down MySQL ...' 91 | mysqladmin $admin_flags flush-privileges shutdown 92 | } 93 | 94 | # Initialize the MySQL database (create user accounts and the initial database) 95 | function initialize_database() { 96 | log_info 'Initializing database ...' 97 | log_info 'Running mysql_install_db ...' 98 | # Using --rpm since we need mysql_install_db behaves as in RPM 99 | # Using --auth-root-authentication-method=normal because we are not root in the container 100 | # Using --skip-test-db because the anonymous users are not recomended in the production databases. With this option no test database and no anonymous users will be created (GH issue #198) 101 | mysql_install_db --rpm --datadir=$MYSQL_DATADIR --auth-root-authentication-method=normal --skip-test-db 102 | start_local_mysql "$@" 103 | 104 | # Running mysql_upgrade creates the mysql_upgrade_info file in the data dir, 105 | # which is necessary to detect which version of the mysqld daemon created the data. 106 | # Checking empty file should not take longer than a second and one extra check should not harm. 107 | mysql_upgrade ${admin_flags} 108 | 109 | if [ -v MYSQL_RUNNING_AS_SLAVE ]; then 110 | log_info 'Initialization finished' 111 | return 0 112 | fi 113 | 114 | if [ -v MYSQL_RUNNING_AS_MASTER ]; then 115 | # Save master status into a separate database. 116 | STATUS_INFO=$(mysql $admin_flags -e 'SHOW MASTER STATUS\G') 117 | BINLOG_POSITION=$(echo "$STATUS_INFO" | grep 'Position:' | head -n 1 | sed -e 's/^\s*Position: //') 118 | BINLOG_FILE=$(echo "$STATUS_INFO" | grep 'File:' | head -n 1 | sed -e 's/^\s*File: //') 119 | GTID_INFO=$(mysql $admin_flags -e "SELECT BINLOG_GTID_POS('$BINLOG_FILE', '$BINLOG_POSITION') AS gtid_value \G") 120 | GTID_VALUE=$(echo "$GTID_INFO" | grep 'gtid_value:' | head -n 1 | sed -e 's/^\s*gtid_value: //') 121 | 122 | mysqladmin $admin_flags create replication 123 | mysql $admin_flags < "10.0" ] ; then 166 | mysql $mysql_flags </dev/null && log_info "MySQL master is ready" && return 0 195 | sleep 1 196 | done 197 | } 198 | 199 | # get_matched_files finds file for image extending 200 | function get_matched_files() { 201 | local custom_dir default_dir 202 | custom_dir="$1" 203 | default_dir="$2" 204 | files_matched="$3" 205 | find "$default_dir" -maxdepth 1 -type f -name "$files_matched" -printf "%f\n" 206 | [ -d "$custom_dir" ] && find "$custom_dir" -maxdepth 1 -type f -name "$files_matched" -printf "%f\n" 207 | } 208 | 209 | # process_extending_files process extending files in $1 and $2 directories 210 | # - source all *.sh files 211 | # (if there are files with same name source only file from $1) 212 | function process_extending_files() { 213 | local custom_dir default_dir 214 | custom_dir=$1 215 | default_dir=$2 216 | 217 | while read filename ; do 218 | echo "=> sourcing $filename ..." 219 | # Custom file is prefered 220 | if [ -f $custom_dir/$filename ]; then 221 | source $custom_dir/$filename 222 | else 223 | source $default_dir/$filename 224 | fi 225 | done <<<"$(get_matched_files "$custom_dir" "$default_dir" '*.sh' | sort -u)" 226 | } 227 | 228 | # process extending config files in $1 and $2 directories 229 | # - expand variables in *.cnf and copy the files into /etc/my.cnf.d directory 230 | # (if there are files with same name source only file from $1) 231 | function process_extending_config_files() { 232 | local custom_dir default_dir 233 | custom_dir=$1 234 | default_dir=$2 235 | 236 | while read filename ; do 237 | echo "=> sourcing $filename ..." 238 | # Custom file is prefered 239 | if [ -f $custom_dir/$filename ]; then 240 | envsubst < $custom_dir/$filename > /etc/my.cnf.d/$filename 241 | else 242 | envsubst < $default_dir/$filename > /etc/my.cnf.d/$filename 243 | fi 244 | done <<<"$(get_matched_files "$custom_dir" "$default_dir" '*.cnf' | sort -u)" 245 | } 246 | 247 | # Converts string version to the integer format (5.5.33 is converted to 505, 248 | # 10.1.23-MariaDB is converted into 1001, etc. 249 | function version2number() { 250 | local version_major=$(echo "$1" | grep -o -e '^[0-9]*\.[0-9]*') 251 | printf %d%02d ${version_major%%.*} ${version_major##*.} 252 | } 253 | 254 | # Converts the version in format of an integer into major.minor 255 | function number2version() { 256 | local numver=${1} 257 | echo $((numver / 100)).$((numver % 100)) 258 | } 259 | 260 | # Prints version of the mysqld that is currently available (string) 261 | function mysqld_version() { 262 | ${MYSQL_PREFIX}/libexec/mysqld -V | awk '{print $3}' 263 | } 264 | 265 | # Returns version from the daemon in integer format 266 | function mysqld_compat_version() { 267 | version2number $(mysqld_version) 268 | } 269 | 270 | # Returns version from the datadir in the integer format 271 | function get_datadir_version() { 272 | local datadir="$1" 273 | local upgrade_info_file=$(get_mysql_upgrade_info_file "$datadir") 274 | [ -r "$upgrade_info_file" ] || return 275 | local version_text=$(cat "$upgrade_info_file" | head -n 1) 276 | version2number "${version_text}" 277 | } 278 | 279 | # Returns name of the file in the datadir that holds version information about the data 280 | function get_mysql_upgrade_info_file() { 281 | local datadir="$1" 282 | echo "$datadir/mysql_upgrade_info" 283 | } 284 | 285 | # Writes version string of the daemon into mysql_upgrade_info file 286 | # (should be only used when the file is missing and only during limited time; 287 | # once most deployments include this version file, we should leave it on 288 | # scripts to generate the file right after initialization or when upgrading) 289 | function write_mysql_upgrade_info_file() { 290 | local datadir="$1" 291 | local version=$(mysqld_version) 292 | local upgrade_info_file=$(get_mysql_upgrade_info_file "$datadir") 293 | if [ -f "$datadir/mysql_upgrade_info" ] ; then 294 | echo "File ${upgrade_info_file} exists, nothing is done." 295 | else 296 | log_info "Storing version '${version}' information into the data dir '${upgrade_info_file}'" 297 | echo "${version}" > "${upgrade_info_file}" 298 | mysqld_version >"$datadir/mysql_upgrade_info" 299 | fi 300 | } 301 | -------------------------------------------------------------------------------- /root-common/usr/share/container-scripts/mysql/helpers.sh: -------------------------------------------------------------------------------- 1 | function log_info { 2 | echo "---> `date +%T` $@" 3 | } 4 | 5 | function log_warn { 6 | echo "---> `date +%T` Warning: $@" 7 | } 8 | 9 | function log_and_run { 10 | log_info "Running $@" 11 | "$@" 12 | } 13 | 14 | function log_volume_info { 15 | CONTAINER_DEBUG=${CONTAINER_DEBUG:-} 16 | if [[ "${CONTAINER_DEBUG,,}" != "true" ]]; then 17 | return 18 | fi 19 | 20 | log_info "Volume info for $@:" 21 | set +e 22 | log_and_run mount 23 | while [ $# -gt 0 ]; do 24 | log_and_run ls -alZ $1 25 | shift 26 | done 27 | set -e 28 | if [[ -v DEBUG_IGNORE_SCRIPT_FAILURES ]]; then 29 | set +e 30 | fi 31 | } 32 | -------------------------------------------------------------------------------- /root-common/usr/share/container-scripts/mysql/init/40-datadir-action.sh: -------------------------------------------------------------------------------- 1 | upstream_upgrade_info() { 2 | echo -n "For upstream documentation about upgrading, see: " 3 | case ${MYSQL_VERSION} in 4 | 10.0) echo "https://mariadb.com/kb/en/library/upgrading-from-mariadb-55-to-mariadb-100/" ;; 5 | 10.1) echo "https://mariadb.com/kb/en/library/upgrading-from-mariadb-100-to-mariadb-101/" ;; 6 | 10.2) echo "https://mariadb.com/kb/en/library/upgrading-from-mariadb-101-to-mariadb-102/" ;; 7 | 10.3) echo "https://mariadb.com/kb/en/library/upgrading-from-mariadb-102-to-mariadb-103/" ;; 8 | 10.5) echo "https://mariadb.com/kb/en/upgrading-from-mariadb-103-to-mariadb-104/" 9 | echo "https://mariadb.com/kb/en/upgrading-from-mariadb-104-to-mariadb-105/" ;; 10 | 5.6) echo "https://dev.mysql.com/doc/refman/5.6/en/upgrading-from-previous-series.html" ;; 11 | 5.7) echo "https://dev.mysql.com/doc/refman/5.7/en/upgrading-from-previous-series.html" ;; 12 | *) echo "Non expected version '${MYSQL_VERSION}'" ; return 1 ;; 13 | esac 14 | } 15 | 16 | check_datadir_version() { 17 | local datadir="$1" 18 | local datadir_version=$(get_datadir_version "$datadir") 19 | local mysqld_version=$(mysqld_compat_version) 20 | local datadir_version_dot=$(number2version "${datadir_version}") 21 | local mysqld_version_dot=$(number2version "${mysqld_version}") 22 | 23 | for datadir_action in ${MYSQL_DATADIR_ACTION//,/ } ; do 24 | log_info "Running datadir action: ${datadir_action}" 25 | case ${datadir_action} in 26 | upgrade-auto|upgrade-warn) 27 | if [ -z "${datadir_version}" ] || [ "${datadir_version}" -eq 0 ] ; then 28 | # Writing the info file, since historically it was not written 29 | log_warn "Version of the data could not be determined."\ 30 | "It is because the file mysql_upgrade_info is missing in the data directory, which"\ 31 | "is most probably because it was not created when initialization of data directory."\ 32 | "In order to allow seamless updates to the next higher version in the future,"\ 33 | "the file mysql_upgrade_info will be created."\ 34 | "If the data directory was created with a different version than ${mysqld_version_dot},"\ 35 | "it is required to run this container with the MYSQL_DATADIR_ACTION environment variable"\ 36 | "set to 'force', or run 'mysql_upgrade' utility manually; the mysql_upgrade tool"\ 37 | "checks the tables and creates such a file as well. $(upstream_upgrade_info)" 38 | write_mysql_upgrade_info_file "${MYSQL_DATADIR}" 39 | continue 40 | # This is currently a dead-code, but should be enabled after the mysql_upgrade_info 41 | # file gets to the deployments (after few months most of the deployments should already have the file) 42 | log_warn "Version of the data could not be determined."\ 43 | "Running such a container is risky."\ 44 | "The current daemon version is ${mysqld_version_dot}."\ 45 | "If you are not sure whether the data directory is compatible with the current"\ 46 | "version ${mysqld_version_dot}, restore the data from a back-up."\ 47 | "If restoring from a back-up is not possible, create a file 'mysql_upgrade_info'"\ 48 | "that includes version information (${mysqld_version_dot} in this case) in the root"\ 49 | "of the data directory."\ 50 | "In order to create the 'mysql_upgrade_info' file, either run this container with"\ 51 | "the MYSQL_DATADIR_ACTION environment variable set to 'force', or run 'mysql_upgrade' utility"\ 52 | "manually; the mysql_upgrade tool checks the tables and creates such a file as well."\ 53 | "That will enable correct upgrade check in the future. $(upstream_upgrade_info)" 54 | fi 55 | 56 | if [ "${datadir_version}" -eq "${mysqld_version}" ] ; then 57 | log_info "MySQL server version check passed, both server and data directory"\ 58 | "are version ${mysqld_version_dot}." 59 | continue 60 | fi 61 | 62 | if [ $(( ${datadir_version} + 1 )) -eq "${mysqld_version}" ] || [ "${datadir_version}" -eq 505 -a "${mysqld_version}" -eq 1000 ] || \ 63 | [ "${datadir_version}" -eq 1003 -a "${mysqld_version}" -eq 1005 ] || [ "${datadir_version}" -eq 1005 -a "${mysqld_version}" -eq 1011 ] ; then 64 | 65 | log_warn "MySQL server is version ${mysqld_version_dot} and datadir is version"\ 66 | "${datadir_version_dot}, which is a compatible combination." 67 | if [ "${MYSQL_DATADIR_ACTION}" == 'upgrade-auto' ] ; then 68 | log_info "The data directory will be upgraded automatically from ${datadir_version_dot}"\ 69 | "to version ${mysqld_version_dot}. $(upstream_upgrade_info)" 70 | log_and_run mysql_upgrade ${mysql_flags} 71 | else 72 | log_warn "Automatic upgrade is not turned on, proceed with the upgrade."\ 73 | "In order to upgrade the data directory, run this container with the MYSQL_DATADIR_ACTION"\ 74 | "environment variable set to 'upgrade-auto' or run mysql_upgrade manually. $(upstream_upgrade_info)" 75 | fi 76 | else 77 | log_warn "MySQL server is version ${mysqld_version_dot} and datadir is version"\ 78 | "${datadir_version_dot}, which are incompatible. Remember, that upgrade is only supported"\ 79 | "by upstream from previous version and it is not allowed to skip versions. $(upstream_upgrade_info)" 80 | if [ "${datadir_version}" -gt "${mysqld_version}" ] ; then 81 | log_warn "Downgrading to the lower version is not supported. Consider"\ 82 | "dumping data and load them again into a fresh instance. $(upstream_upgrade_info)" 83 | fi 84 | log_warn "Consider restoring the database from a back-up. To ignore this"\ 85 | "warning, set 'MYSQL_DATADIR_ACTION' variable to 'upgrade-force', but this may result in data corruption. $(upstream_upgrade_info)" 86 | return 1 87 | fi 88 | ;; 89 | 90 | upgrade-force) 91 | log_and_run mysql_upgrade ${mysql_flags} --force 92 | ;; 93 | 94 | optimize) 95 | log_and_run mysqlcheck ${mysql_flags} --optimize --all-databases --force 96 | ;; 97 | 98 | analyze) 99 | log_and_run mysqlcheck ${mysql_flags} --analyze --all-databases --force 100 | ;; 101 | 102 | disable) 103 | log_info "Nothing is done about the data directory." 104 | ;; 105 | *) 106 | log_warn "Unknown value of MYSQL_DATADIR_ACTION variable: '${MYSQL_DATADIR_ACTION}', ignoring." 107 | ;; 108 | esac 109 | done 110 | } 111 | 112 | check_datadir_version "${MYSQL_DATADIR}" 113 | 114 | unset -f check_datadir_version upstream_upgrade_info 115 | 116 | 117 | -------------------------------------------------------------------------------- /root-common/usr/share/container-scripts/mysql/init/50-passwd-change.sh: -------------------------------------------------------------------------------- 1 | password_change() { 2 | log_info 'Setting passwords ...' 3 | 4 | # Set the password for MySQL user and root everytime this container is started. 5 | # This allows to change the password by editing the deployment configuration. 6 | if [[ -v MYSQL_USER && -v MYSQL_PASSWORD ]]; then 7 | local user_maches=$(echo "SELECT COUNT(*) AS found FROM mysql.user WHERE user='${MYSQL_USER}' AND Host='%' \G" | mysql $mysql_flags) 8 | if ! echo "${user_maches}" | grep -q 'found: 1' ; then 9 | log_info "WARNING: User ${MYSQL_USER} does not exist in database. Password not changed." 10 | else 11 | mysql $mysql_flags < "10.0" ] ; then 24 | mysql $mysql_flags < "10.0" ] ; then 33 | mysql $mysql_flags < /etc/my.cnf.d/base.cnf 3 | 4 | -------------------------------------------------------------------------------- /root-common/usr/share/container-scripts/mysql/pre-init/60-replication-config.sh: -------------------------------------------------------------------------------- 1 | # mysqld configuration for replication scenarios 2 | 3 | if [ -v MYSQL_RUNNING_AS_MASTER ] || [ -v MYSQL_RUNNING_AS_SLAVE ] ; then 4 | log_info 'Processing basic MySQL configuration for replication (master and slave) files ...' 5 | envsubst < ${CONTAINER_SCRIPTS_PATH}/pre-init/my-repl-gtid.cnf.template > /etc/my.cnf.d/repl-gtid.cnf 6 | fi 7 | 8 | if [ -v MYSQL_RUNNING_AS_MASTER ] ; then 9 | log_info 'Processing basic MySQL configuration for replication (master only) files ...' 10 | envsubst < ${CONTAINER_SCRIPTS_PATH}/pre-init/my-master.cnf.template > /etc/my.cnf.d/master.cnf 11 | fi 12 | 13 | if [ -v MYSQL_RUNNING_AS_SLAVE ] ; then 14 | log_info 'Processing basic MySQL configuration for replication (slave only) files ...' 15 | envsubst < ${CONTAINER_SCRIPTS_PATH}/pre-init/my-slave.cnf.template > /etc/my.cnf.d/slave.cnf 16 | fi 17 | 18 | -------------------------------------------------------------------------------- /root-common/usr/share/container-scripts/mysql/pre-init/70-s2i-config.sh: -------------------------------------------------------------------------------- 1 | # additional arbitrary mysqld configuration provided by user using s2i 2 | 3 | log_info 'Processing additional arbitrary MySQL configuration provided by s2i ...' 4 | 5 | process_extending_config_files ${APP_DATA}/mysql-cfg/ ${CONTAINER_SCRIPTS_PATH}/cnf/ 6 | 7 | -------------------------------------------------------------------------------- /root-common/usr/share/container-scripts/mysql/pre-init/my-base.cnf.template: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | datadir = ${MYSQL_DATADIR} 3 | basedir = ${MYSQL_PREFIX} 4 | plugin-dir = ${MYSQL_PREFIX}/lib64/mariadb/plugin 5 | 6 | -------------------------------------------------------------------------------- /root-common/usr/share/container-scripts/mysql/pre-init/my-master.cnf.template: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | 3 | server-id = ${MYSQL_SERVER_ID} 4 | log_bin = ${MYSQL_DATADIR}/mysql-bin.log 5 | # Not using explicit DB filtering, from some unknown reason this makes the user 6 | # permissions not being replicated on 10.5 and further 7 | # binlog_do_db = mysql 8 | # binlog_do_db = ${MYSQL_DATABASE} 9 | binlog_format = ${MYSQL_BINLOG_FORMAT} 10 | -------------------------------------------------------------------------------- /root-common/usr/share/container-scripts/mysql/pre-init/my-repl-gtid.cnf.template: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | 3 | log-slave-updates = ON 4 | 5 | -------------------------------------------------------------------------------- /root-common/usr/share/container-scripts/mysql/pre-init/my-slave.cnf.template: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | 3 | server-id = ${MYSQL_SERVER_ID} 4 | log_bin = ${MYSQL_DATADIR}/mysql-bin.log 5 | relay-log = ${MYSQL_DATADIR}/mysql-relay-bin.log 6 | # Not using explicit DB filtering, from some unknown reason this makes the user 7 | # permissions not being replicated on 10.5 and further 8 | # binlog_do_db = mysql 9 | # binlog_do_db = ${MYSQL_DATABASE} 10 | -------------------------------------------------------------------------------- /root-common/usr/share/container-scripts/mysql/scl_enable: -------------------------------------------------------------------------------- 1 | # This will make scl collection binaries work out of box. 2 | unset BASH_ENV PROMPT_COMMAND ENV 3 | source scl_source enable ${ENABLED_COLLECTIONS} 4 | -------------------------------------------------------------------------------- /s2i-common/bin/assemble: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o errexit 4 | set -o nounset 5 | set -o pipefail 6 | 7 | shopt -s dotglob 8 | echo "---> Installing application source ..." 9 | mv /tmp/src/* ./ 2>/dev/null || true 10 | 11 | # Fix source directory permissions 12 | /usr/libexec/fix-permissions ./ 13 | 14 | -------------------------------------------------------------------------------- /s2i-common/bin/usage: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -o errexit 4 | set -o nounset 5 | set -o pipefail 6 | 7 | groff -t -man -ETascii /help.1 8 | 9 | -------------------------------------------------------------------------------- /test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sclorg/mariadb-container/6529b302e016a82afcb4e1c4cbae4d61824e4c78/test/__init__.py -------------------------------------------------------------------------------- /test/check_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../common/check_imagestreams.py -------------------------------------------------------------------------------- /test/constants.py: -------------------------------------------------------------------------------- 1 | TAGS = { 2 | "rhel8": "-el8", 3 | "rhel9": "-el9", 4 | "rhel10": "-el10", 5 | } 6 | -------------------------------------------------------------------------------- /test/examples: -------------------------------------------------------------------------------- 1 | ../examples/ -------------------------------------------------------------------------------- /test/imagestreams: -------------------------------------------------------------------------------- 1 | ../imagestreams/ -------------------------------------------------------------------------------- /test/mariadb-ephemeral-template.json: -------------------------------------------------------------------------------- 1 | ../examples/mariadb-ephemeral-template.json -------------------------------------------------------------------------------- /test/mariadb-persistent-template.json: -------------------------------------------------------------------------------- 1 | ../examples/mariadb-persistent-template.json -------------------------------------------------------------------------------- /test/run-openshift-pytest: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # IMAGE_NAME specifies a name of the candidate image used for testing. 4 | # The image has to be available before this script is executed. 5 | # VERSION specifies the major version of the MariaDB in format of X.Y 6 | # OS specifies RHEL version (e.g. OS=rhel7) 7 | # 8 | 9 | THISDIR=$(dirname ${BASH_SOURCE[0]}) 10 | 11 | git show -s 12 | 13 | cd "${THISDIR}" && python3.12 -m pytest -s -rA --showlocals -vv test_mariadb_*.py 14 | -------------------------------------------------------------------------------- /test/run-openshift-remote-cluster: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Test the MariaDB image in OpenShift (remote cluster) 4 | # 5 | # IMAGE_NAME specifies a name of the candidate image used for testing. 6 | # The image has to be available before this script is executed. 7 | # VERSION specifies the major version of the MariaDB in format of X.Y 8 | # OS specifies RHEL version (e.g. OS=rhel8) 9 | # 10 | 11 | THISDIR=$(dirname ${BASH_SOURCE[0]}) 12 | 13 | source "${THISDIR}/test-lib-mysql.sh" 14 | source "${THISDIR}/test-lib-remote-openshift.sh" 15 | 16 | TEST_LIST="\ 17 | test_mariadb_integration 18 | test_mariadb_imagestream 19 | test_mariadb_template 20 | run_latest_imagestreams 21 | " 22 | 23 | trap ct_os_cleanup EXIT SIGINT 24 | 25 | ct_os_set_ocp4 || exit $OC_ERR 26 | 27 | ct_os_check_compulsory_vars || exit $OC_ERR 28 | 29 | ct_os_check_login || exit $OC_ERR 30 | 31 | ct_os_tag_image_for_cvp "mariadb" 32 | 33 | set -u 34 | 35 | # For testing on OpenShift 4 we use internal registry 36 | export CT_OCP4_TEST=true 37 | 38 | TEST_SUMMARY='' 39 | TEST_SET=${TESTS:-$TEST_LIST} ct_run_tests_from_testset "openshift-remote-cluster" 40 | # vim: set tabstop=2:shiftwidth=2:expandtab: 41 | 42 | -------------------------------------------------------------------------------- /test/show_all_imagestreams.py: -------------------------------------------------------------------------------- 1 | ../common/show_all_imagestreams.py -------------------------------------------------------------------------------- /test/test-app: -------------------------------------------------------------------------------- 1 | ../examples/extend-image/ -------------------------------------------------------------------------------- /test/test-lib-mysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Functions for tests for the MariaDB image in OpenShift. 4 | # 5 | # IMAGE_NAME specifies a name of the candidate image used for testing. 6 | # The image has to be available before this script is executed. 7 | # 8 | 9 | THISDIR=$(dirname ${BASH_SOURCE[0]}) 10 | 11 | source "${THISDIR}/test-lib.sh" 12 | source "${THISDIR}/test-lib-openshift.sh" 13 | source "${THISDIR}/test-lib-remote-openshift.sh" 14 | 15 | function check_mysql_os_service_connection() { 16 | local util_image_name="${1}" ; shift 17 | local service_name="${1}" ; shift 18 | local user="${1}" ; shift 19 | local pass="${1}" ; shift 20 | local timeout="${1:-60}" ; shift || : 21 | local pod_ip=$(ct_os_get_service_ip ${service_name}) 22 | 23 | : " Service ${service_name} check ..." 24 | 25 | local cmd="echo 'SELECT 42 as testval\g' | mysql --connect-timeout=15 -h ${pod_ip} -u${user} -p${pass}" 26 | local expected_value='^42' 27 | local output 28 | local ret 29 | SECONDS=0 30 | 31 | echo -n "Waiting for ${service_name} service becoming ready ..." 32 | while true ; do 33 | output=$(docker run --rm ${util_image_name} bash -c "${cmd}" || :) 34 | echo "${output}" | grep -qe "${expected_value}" && ret=0 || ret=1 35 | if [ ${ret} -eq 0 ] ; then 36 | echo " PASS" 37 | return 0 38 | fi 39 | echo -n "." 40 | [ ${SECONDS} -gt ${timeout} ] && break 41 | sleep 3 42 | done 43 | echo " FAIL" 44 | return 1 45 | } 46 | 47 | function test_mysql_pure_image() { 48 | local image_name=${1:-quay.io/sclorg/mariadb-105-c9s} 49 | local image_name_no_namespace=${image_name##*/} 50 | local service_name="${image_name_no_namespace%%:*}-testing" 51 | 52 | ct_os_new_project 53 | # Create a specific imagestream tag for the image so that oc cannot use anything else 54 | ct_os_upload_image "v3" "${image_name}" "$image_name_no_namespace" 55 | 56 | ct_os_deploy_pure_image "$image_name_no_namespace" \ 57 | --name "${service_name}" \ 58 | --env MYSQL_ROOT_PASSWORD=test 59 | 60 | ct_os_wait_pod_ready "${service_name}" 60 61 | check_mysql_os_service_connection "${image_name}" "${service_name}" root test 62 | 63 | ct_os_delete_project 64 | } 65 | 66 | function test_mysql_template() { 67 | local image_name=${1:-quay.io/sclorg/mariadb-105-c9s} 68 | local image_name_no_namespace=${image_name##*/} 69 | local service_name="${image_name_no_namespace%%:*}-testing" 70 | 71 | ct_os_new_project 72 | ct_os_upload_image "v3" "${image_name}" "mariadb:$VERSION" 73 | 74 | ct_os_deploy_template_image ${THISDIR}/mariadb-ephemeral-template.json \ 75 | NAMESPACE="$(oc project -q)" \ 76 | MARIADB_VERSION="$VERSION" \ 77 | DATABASE_SERVICE_NAME="${service_name}" \ 78 | MYSQL_USER=testu \ 79 | MYSQL_PASSWORD=testp \ 80 | MYSQL_DATABASE=testdb 81 | 82 | ct_os_wait_pod_ready "${service_name}" 60 83 | check_mysql_os_service_connection "${image_name}" "${service_name}" testu testp 84 | 85 | ct_os_delete_project 86 | } 87 | 88 | function test_mysql_s2i() { 89 | local image_name=${1:-quay.io/sclorg/mariadb-105-c9s} 90 | local app=${2:-https://github.com/sclorg/mariadb-container.git} 91 | local context_dir=${3:-test/test-app} 92 | local image_name_no_namespace=${image_name##*/} 93 | local service_name="${image_name_no_namespace%%:*}-testing" 94 | 95 | ct_os_new_project 96 | # Create a specific imagestream tag for the image so that oc cannot use anything else 97 | ct_os_upload_image "v3" "${image_name}" "$image_name_no_namespace" 98 | 99 | ct_os_deploy_s2i_image "$image_name_no_namespace" "${app}" \ 100 | --context-dir="${context_dir}" \ 101 | --name "${service_name}" \ 102 | --env MYSQL_ROOT_PASSWORD=test \ 103 | --env MYSQL_OPERATIONS_USER=testo \ 104 | --env MYSQL_OPERATIONS_PASSWORD=testo \ 105 | --env MYSQL_DATABASE=testopdb \ 106 | --env MYSQL_USER=testnormal \ 107 | --env MYSQL_PASSWORD=testnormal 108 | 109 | ct_os_wait_pod_ready "${service_name}" 60 110 | check_mysql_os_service_connection "${image_name}" "${service_name}" testo testo 120 111 | 112 | ct_os_delete_project 113 | } 114 | 115 | function test_mariadb_integration() { 116 | local service_name=mariadb 117 | TEMPLATES="mariadb-ephemeral-template.json 118 | mariadb-persistent-template.json" 119 | SHORT_VERSION="${VERSION//.}" 120 | # MariaDB-103 exists only for RHEL8 and MariaDB exists only for all versions so let's use version 10.5 121 | namespace_image="${OS}/mariadb-105" 122 | # Check if the current version is already GA 123 | # This directory is cloned from TMT plan repo 'sclorg-tmt-plans' 124 | local devel_file="/root/sclorg-tmt-plans/devel_images" 125 | if [ -f "${devel_file}" ]; then 126 | if grep -q "${OS}=mariadb-container=${VERSION}" "$devel_file" ; then 127 | echo "This version is currently developed, so skipping this test." 128 | return 129 | fi 130 | fi 131 | for template in $TEMPLATES; do 132 | ct_os_test_template_app_func "${IMAGE_NAME}" \ 133 | "${THISDIR}/${template}" \ 134 | "${service_name}" \ 135 | "ct_os_check_cmd_internal 'registry.redhat.io/${namespace_image}' '${service_name}-testing' \"echo 'SELECT 42 as testval\g' | mysql --connect-timeout=15 -h testdb -utestu -ptestp\" '^42' 120" \ 136 | "-p MARIADB_VERSION=${VERSION} \ 137 | -p DATABASE_SERVICE_NAME="${service_name}-testing" \ 138 | -p MYSQL_USER=testu \ 139 | -p MYSQL_PASSWORD=testp \ 140 | -p MYSQL_DATABASE=testdb" 141 | done 142 | } 143 | 144 | # Check the imagestream 145 | function test_mariadb_imagestream() { 146 | local tag="-el8" 147 | if [ "${OS}" == "rhel9" ]; then 148 | tag="-el9" 149 | elif [ "${OS}" == "rhel10" ]; then 150 | tag="-el10" 151 | fi 152 | 153 | # Check if the current version is already GA 154 | # This directory is cloned from TMT plan repo 'sclorg-tmt-plans' 155 | local devel_file="/root/sclorg-tmt-plans/devel_images" 156 | if [ -f "${devel_file}" ]; then 157 | if grep -q "${OS}=mariadb-container=${VERSION}" "$devel_file" ; then 158 | echo "This version is currently developed, so skipping this test." 159 | return 160 | fi 161 | fi 162 | TEMPLATES="mariadb-ephemeral-template.json 163 | mariadb-persistent-template.json" 164 | for template in $TEMPLATES; do 165 | ct_os_test_image_stream_template "${THISDIR}/imagestreams/mariadb-${OS//[0-9]/}.json" "${THISDIR}/examples/${template}" mariadb "-p MARIADB_VERSION=${VERSION}${tag}" 166 | done 167 | } 168 | 169 | function test_mariadb_template() { 170 | # Check if the current version is already GA 171 | # This directory is cloned from TMT plan repo 'sclorg-tmt-plans' 172 | local devel_file="/root/sclorg-tmt-plans/devel_images" 173 | if [ -f "${devel_file}" ]; then 174 | if grep -q "${OS}=mariadb-container=${VERSION}" "$devel_file" ; then 175 | echo "This version is currently developed, so skipping this test." 176 | return 177 | fi 178 | fi 179 | TEMPLATES="mariadb-ephemeral-template.json 180 | mariadb-persistent-template.json" 181 | for template in $TEMPLATES; do 182 | ct_os_test_image_stream_template "${THISDIR}/imagestreams/mariadb-${OS//[0-9]/}.json" "${THISDIR}/examples/${template}" mariadb 183 | done 184 | } 185 | 186 | 187 | # Check the latest imagestreams 188 | function run_latest_imagestreams() { 189 | # Check if the current version is already GA 190 | # This directory is cloned from TMT plan repo 'sclorg-tmt-plans' 191 | local devel_file="/root/sclorg-tmt-plans/devel_images" 192 | if [ -f "${devel_file}" ]; then 193 | if grep -q "${OS}=mariadb-container=${VERSION}" "$devel_file" ; then 194 | echo "This version is currently developed, so skipping this test." 195 | return 196 | fi 197 | fi 198 | local result=1 199 | # Switch to root directory of a container 200 | echo "Testing the latest version in imagestreams" 201 | pushd "${THISDIR}/../.." >/dev/null || return 1 202 | ct_check_latest_imagestreams 203 | result=$? 204 | popd >/dev/null || return 1 205 | return $result 206 | } 207 | # vim: set tabstop=2:shiftwidth=2:expandtab: 208 | -------------------------------------------------------------------------------- /test/test-lib-openshift.sh: -------------------------------------------------------------------------------- 1 | ../common/test-lib-openshift.sh -------------------------------------------------------------------------------- /test/test-lib-remote-openshift.sh: -------------------------------------------------------------------------------- 1 | ../common/test-lib-remote-openshift.sh -------------------------------------------------------------------------------- /test/test-lib.sh: -------------------------------------------------------------------------------- 1 | ../common/test-lib.sh -------------------------------------------------------------------------------- /test/test-openshift.yaml: -------------------------------------------------------------------------------- 1 | ../common/test-openshift.yaml -------------------------------------------------------------------------------- /test/test_mariadb_imagestream.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | import pytest 5 | 6 | from container_ci_suite.openshift import OpenShiftAPI 7 | from container_ci_suite.utils import check_variables 8 | 9 | from constants import TAGS 10 | 11 | if not check_variables(): 12 | print("At least one variable from IMAGE_NAME, OS, VERSION is missing.") 13 | sys.exit(1) 14 | 15 | 16 | VERSION = os.getenv("VERSION") 17 | IMAGE_NAME = os.getenv("IMAGE_NAME") 18 | OS = os.getenv("TARGET") 19 | 20 | TAG = TAGS.get(OS) 21 | 22 | 23 | class TestMariaDBImagestreamTemplate: 24 | 25 | def setup_method(self): 26 | self.oc_api = OpenShiftAPI(pod_name_prefix="mariadb", version=VERSION, shared_cluster=True) 27 | 28 | def teardown_method(self): 29 | self.oc_api.delete_project() 30 | 31 | @pytest.mark.parametrize( 32 | "template", 33 | [ 34 | "mariadb-ephemeral-template.json", 35 | "mariadb-persistent-template.json" 36 | ] 37 | ) 38 | def test_mariadb_imagestream_template(self, template): 39 | os_name = ''.join(i for i in OS if not i.isdigit()) 40 | print(os.getcwd()) 41 | assert self.oc_api.deploy_image_stream_template( 42 | imagestream_file=f"imagestreams/mariadb-{os_name}.json", 43 | template_file=f"examples/{template}", 44 | app_name=self.oc_api.pod_name_prefix, 45 | openshift_args=[ 46 | f"MARIADB_VERSION={VERSION}{TAG}" 47 | ] 48 | ) 49 | assert self.oc_api.is_pod_running(pod_name_prefix=self.oc_api.pod_name_prefix) 50 | -------------------------------------------------------------------------------- /test/test_mariadb_imagestream_template.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | import pytest 5 | 6 | from container_ci_suite.openshift import OpenShiftAPI 7 | from container_ci_suite.utils import check_variables 8 | 9 | from constants import TAGS 10 | 11 | if not check_variables(): 12 | print("At least one variable from IMAGE_NAME, OS, VERSION is missing.") 13 | sys.exit(1) 14 | 15 | 16 | VERSION = os.getenv("VERSION") 17 | IMAGE_NAME = os.getenv("IMAGE_NAME") 18 | OS = os.getenv("TARGET") 19 | 20 | TAG = TAGS.get(OS) 21 | 22 | 23 | class TestMariaDBImagestreamTemplate: 24 | 25 | def setup_method(self): 26 | self.oc_api = OpenShiftAPI(pod_name_prefix="mariadb", version=VERSION, shared_cluster=True) 27 | 28 | def teardown_method(self): 29 | self.oc_api.delete_project() 30 | 31 | @pytest.mark.parametrize( 32 | "template", 33 | [ 34 | "mariadb-ephemeral-template.json", 35 | "mariadb-persistent-template.json" 36 | ] 37 | ) 38 | def test_mariadb_imagestream_template(self, template): 39 | os_name = ''.join(i for i in OS if not i.isdigit()) 40 | assert self.oc_api.deploy_image_stream_template( 41 | imagestream_file=f"imagestreams/mariadb-{os_name}.json", 42 | template_file=f"examples/{template}", 43 | app_name=self.oc_api.pod_name_prefix 44 | ) 45 | assert self.oc_api.is_pod_running(pod_name_prefix=self.oc_api.pod_name_prefix) 46 | -------------------------------------------------------------------------------- /test/test_mariadb_latest_imagestreams.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import pytest 4 | 5 | from pathlib import Path 6 | 7 | from container_ci_suite.imagestreams import ImageStreamChecker 8 | from container_ci_suite.utils import check_variables 9 | 10 | TEST_DIR = Path(os.path.abspath(os.path.dirname(__file__))) 11 | 12 | if not check_variables(): 13 | print("At least one variable from IMAGE_NAME, OS, VERSION is missing.") 14 | sys.exit(1) 15 | 16 | 17 | class TestLatestImagestreams: 18 | 19 | def setup_method(self): 20 | self.isc = ImageStreamChecker(working_dir=TEST_DIR.parent) 21 | 22 | def test_latest_imagestream(self): 23 | self.latest_version = self.isc.get_latest_version() 24 | assert self.latest_version != "" 25 | self.isc.check_imagestreams(self.latest_version) 26 | -------------------------------------------------------------------------------- /test/test_mariadb_local_template.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | import pytest 5 | 6 | from container_ci_suite.openshift import OpenShiftAPI 7 | from container_ci_suite.utils import check_variables 8 | 9 | from constants import TAGS 10 | 11 | if not check_variables(): 12 | print("At least one variable from IMAGE_NAME, OS, VERSION is missing.") 13 | sys.exit(1) 14 | 15 | 16 | VERSION = os.getenv("VERSION") 17 | IMAGE_NAME = os.getenv("IMAGE_NAME") 18 | OS = os.getenv("TARGET") 19 | 20 | TAG = TAGS.get(OS) 21 | 22 | 23 | class TestMariaDBDeployTemplate: 24 | 25 | def setup_method(self): 26 | self.oc_api = OpenShiftAPI(pod_name_prefix="mariadb-testing", version=VERSION, shared_cluster=True) 27 | self.oc_api.import_is("imagestreams/mariadb-rhel.json", "", skip_check=True) 28 | 29 | def teardown_method(self): 30 | self.oc_api.delete_project() 31 | 32 | @pytest.mark.parametrize( 33 | "template", 34 | [ 35 | "mariadb-ephemeral-template.json", 36 | "mariadb-persistent-template.json" 37 | ] 38 | ) 39 | def test_python_template_inside_cluster(self, template): 40 | short_version = VERSION.replace(".", "") 41 | assert self.oc_api.deploy_template_with_image( 42 | image_name=IMAGE_NAME, 43 | template=template, 44 | name_in_template="mariadb", 45 | openshift_args=[ 46 | f"MARIADB_VERSION={VERSION}{TAG}", 47 | f"DATABASE_SERVICE_NAME={self.oc_api.pod_name_prefix}", 48 | f"MYSQL_USER=testu", 49 | f"MYSQL_PASSWORD=testp", 50 | f"MYSQL_DATABASE=testdb" 51 | ] 52 | ) 53 | 54 | assert self.oc_api.is_pod_running(pod_name_prefix=self.oc_api.pod_name_prefix) 55 | assert self.oc_api.check_command_internal( 56 | image_name=f"registry.redhat.io/{OS}/mariadb-{short_version}", 57 | service_name=self.oc_api.pod_name_prefix, 58 | cmd="echo 'SELECT 42 as testval\\g' | mysql --connect-timeout=15 -h testdb -utestu -ptestp", 59 | expected_output="42" 60 | ) 61 | -------------------------------------------------------------------------------- /test/test_mariadb_shared_helm_imagestreams.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import pytest 4 | from pathlib import Path 5 | 6 | from container_ci_suite.helm import HelmChartsAPI 7 | 8 | test_dir = Path(os.path.abspath(os.path.dirname(__file__))) 9 | 10 | 11 | class TestHelmRHELMariadbImageStreams: 12 | 13 | def setup_method(self): 14 | package_name = "redhat-mariadb-imagestreams" 15 | path = test_dir 16 | self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir, shared_cluster=True) 17 | self.hc_api.clone_helm_chart_repo( 18 | repo_url="https://github.com/sclorg/helm-charts", repo_name="helm-charts", 19 | subdir="charts/redhat" 20 | ) 21 | 22 | def teardown_method(self): 23 | self.hc_api.delete_project() 24 | 25 | @pytest.mark.parametrize( 26 | "version,registry,expected", 27 | [ 28 | ("10.11-el10", "registry.redhat.io/rhel10/mariadb-1011:latest", True), 29 | ("10.11-el9", "registry.redhat.io/rhel9/mariadb-1011:latest", True), 30 | ("10.11-el8", "registry.redhat.io/rhel8/mariadb-1011:latest", True), 31 | ("10.5-el9", "registry.redhat.io/rhel9/mariadb-105:latest", True), 32 | ("10.3-el8", "registry.redhat.io/rhel8/mariadb-103:latest", True), 33 | ("10.5-el8", "registry.redhat.io/rhel8/mariadb-105:latest", True), 34 | ], 35 | ) 36 | def test_package_imagestream(self, version, registry, expected): 37 | assert self.hc_api.helm_package() 38 | assert self.hc_api.helm_installation() 39 | assert self.hc_api.check_imagestreams(version=version, registry=registry) == expected 40 | -------------------------------------------------------------------------------- /test/test_mariadb_shared_helm_template.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import pytest 4 | from pathlib import Path 5 | 6 | from container_ci_suite.helm import HelmChartsAPI 7 | 8 | from constants import TAGS 9 | test_dir = Path(os.path.abspath(os.path.dirname(__file__))) 10 | 11 | VERSION = os.getenv("VERSION") 12 | IMAGE_NAME = os.getenv("IMAGE_NAME") 13 | OS = os.getenv("TARGET") 14 | 15 | TAG = TAGS.get(OS) 16 | 17 | 18 | class TestHelmMariaDBPersistent: 19 | 20 | def setup_method(self): 21 | package_name = "redhat-mariadb-persistent" 22 | path = test_dir 23 | self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir, shared_cluster=True) 24 | self.hc_api.clone_helm_chart_repo( 25 | repo_url="https://github.com/sclorg/helm-charts", repo_name="helm-charts", 26 | subdir="charts/redhat" 27 | ) 28 | 29 | def teardown_method(self): 30 | self.hc_api.delete_project() 31 | 32 | def test_package_persistent(self): 33 | self.hc_api.package_name = "redhat-mariadb-imagestreams" 34 | assert self.hc_api.helm_package() 35 | assert self.hc_api.helm_installation() 36 | self.hc_api.package_name = "redhat-mariadb-persistent" 37 | assert self.hc_api.helm_package() 38 | assert self.hc_api.helm_installation( 39 | values={ 40 | "mariadb_version": f"{VERSION}{TAG}", 41 | "namespace": self.hc_api.namespace 42 | } 43 | ) 44 | assert self.hc_api.is_pod_running(pod_name_prefix="mariadb") 45 | assert self.hc_api.test_helm_chart(expected_str=["42", "testval"]) 46 | --------------------------------------------------------------------------------