diff --git a/.github/workflows/build-mysql-container.yaml b/.github/workflows/build-mysql-container.yaml new file mode 100644 index 000000000..ee40706d9 --- /dev/null +++ b/.github/workflows/build-mysql-container.yaml @@ -0,0 +1,61 @@ +name: "Build mysql container" + +on: + pull_request: + paths: + - "containers/mysql/**" + - ".github/workflows/build-mysql-container.yaml" + - "!**.md" + push: + branches: + - 'main' + paths: + - "containers/mysql/**" + - ".github/workflows/build-mysql-container.yaml" + - "!**.md" + +jobs: + build: + runs-on: ubuntu-20.04 + strategy: + matrix: + mysql-version: [ "8.0.18", "8.0.25", "8.0.26", "8.0.27", "8.0.28", "8.0.30", "8.0.31", "8.0.32" ] + steps: + - uses: actions/checkout@v3 + - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-buildx-action@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Check TAG file + working-directory: containers + run: | + result="$(./tag_exists moco/mysql mysql/${{ matrix.mysql-version }})" + if [ "$result" = ng ]; then + exit 1 + fi + echo "TAG=$(cat ./mysql/${{ matrix.mysql-version }}/TAG)" >> $GITHUB_ENV + + - uses: docker/build-push-action@v4 + if: github.ref == 'refs/heads/main' + with: + context: containers/mysql/${{ matrix.mysql-version }}/. + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/cybozu-go/moco/mysql:${{ env.TAG }} + cache-from: type=gha + cache-to: type=gha,mode=max + + - uses: docker/build-push-action@v4 + if: github.event_name == 'pull_request' + with: + context: containers/mysql/${{ matrix.mysql-version }}/. + platforms: linux/amd64,linux/arm64 + push: false + tags: ghcr.io/cybozu-go/moco/mysql:${{ env.TAG }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/containers/mysql/8.0.18/.dockerignore b/containers/mysql/8.0.18/.dockerignore new file mode 100644 index 000000000..c1c4c64ec --- /dev/null +++ b/containers/mysql/8.0.18/.dockerignore @@ -0,0 +1,2 @@ +* +!workspace diff --git a/containers/mysql/8.0.18/Dockerfile b/containers/mysql/8.0.18/Dockerfile new file mode 100644 index 000000000..fefa94474 --- /dev/null +++ b/containers/mysql/8.0.18/Dockerfile @@ -0,0 +1,40 @@ +FROM quay.io/cybozu/ubuntu-dev:22.04 AS builder + +ARG MYSQL_VERSION=8.0.18 + +RUN apt-get update && apt-get -y install --no-install-recommends \ + cmake \ + libncurses5-dev \ + libjemalloc-dev \ + libnuma-dev \ + libaio-dev \ + pkg-config + +RUN cd tmp/ \ + && curl -fsSL -O https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-${MYSQL_VERSION}.tar.gz \ + && tar -x -z -f mysql-boost-${MYSQL_VERSION}.tar.gz \ + && cd mysql-${MYSQL_VERSION} \ + && mkdir bld \ + && cd bld \ + && cmake .. -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=Release -DWITH_BOOST=$(ls -d ../boost/boost_*) -DWITH_NUMA=1 -DWITH_JEMALLOC=1 -DWITH_PACKAGE_FLAGS=0 \ + && make -j 20 \ + && make install + +FROM quay.io/cybozu/ubuntu:22.04 + +COPY --from=builder /usr/local/mysql/LICENSE /usr/local/mysql/LICENSE +COPY --from=builder /usr/local/mysql/bin /usr/local/mysql/bin +COPY --from=builder /usr/local/mysql/lib /usr/local/mysql/lib +COPY --from=builder /usr/local/mysql/share /usr/local/mysql/share + +RUN apt-get update \ + && apt-get install -y --no-install-recommends libjemalloc2 libnuma1 libaio1 \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /var/lib/mysql \ + && chown -R 10000:10000 /var/lib/mysql + +ENV PATH=/usr/local/mysql/bin:"$PATH" +VOLUME /var/lib/mysql +ENTRYPOINT ["mysqld"] +EXPOSE 3306 33060 33062 8080 +USER 10000:10000 diff --git a/containers/mysql/8.0.18/TAG b/containers/mysql/8.0.18/TAG new file mode 100644 index 000000000..8409ca465 --- /dev/null +++ b/containers/mysql/8.0.18/TAG @@ -0,0 +1 @@ +8.0.18.1 diff --git a/containers/mysql/8.0.25/.dockerignore b/containers/mysql/8.0.25/.dockerignore new file mode 100644 index 000000000..c1c4c64ec --- /dev/null +++ b/containers/mysql/8.0.25/.dockerignore @@ -0,0 +1,2 @@ +* +!workspace diff --git a/containers/mysql/8.0.25/Dockerfile b/containers/mysql/8.0.25/Dockerfile new file mode 100644 index 000000000..bc7219dee --- /dev/null +++ b/containers/mysql/8.0.25/Dockerfile @@ -0,0 +1,40 @@ +FROM quay.io/cybozu/ubuntu-dev:22.04 AS builder + +ARG MYSQL_VERSION=8.0.25 + +RUN apt-get update && apt-get -y install --no-install-recommends \ + cmake \ + libncurses5-dev \ + libjemalloc-dev \ + libnuma-dev \ + libaio-dev \ + pkg-config + +RUN cd tmp/ \ + && curl -fsSL -O https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-${MYSQL_VERSION}.tar.gz \ + && tar -x -z -f mysql-boost-${MYSQL_VERSION}.tar.gz \ + && cd mysql-${MYSQL_VERSION} \ + && mkdir bld \ + && cd bld \ + && cmake .. -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=Release -DWITH_BOOST=$(ls -d ../boost/boost_*) -DWITH_NUMA=1 -DWITH_JEMALLOC=1 -DWITH_PACKAGE_FLAGS=0 \ + && make -j 20 \ + && make install + +FROM quay.io/cybozu/ubuntu:22.04 + +COPY --from=builder /usr/local/mysql/LICENSE /usr/local/mysql/LICENSE +COPY --from=builder /usr/local/mysql/bin /usr/local/mysql/bin +COPY --from=builder /usr/local/mysql/lib /usr/local/mysql/lib +COPY --from=builder /usr/local/mysql/share /usr/local/mysql/share + +RUN apt-get update \ + && apt-get install -y --no-install-recommends libjemalloc2 libnuma1 libaio1 \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /var/lib/mysql \ + && chown -R 10000:10000 /var/lib/mysql + +ENV PATH=/usr/local/mysql/bin:"$PATH" +VOLUME /var/lib/mysql +ENTRYPOINT ["mysqld"] +EXPOSE 3306 33060 33062 8080 +USER 10000:10000 diff --git a/containers/mysql/8.0.25/TAG b/containers/mysql/8.0.25/TAG new file mode 100644 index 000000000..012b04e65 --- /dev/null +++ b/containers/mysql/8.0.25/TAG @@ -0,0 +1 @@ +8.0.25.1 diff --git a/containers/mysql/8.0.26/.dockerignore b/containers/mysql/8.0.26/.dockerignore new file mode 100644 index 000000000..c1c4c64ec --- /dev/null +++ b/containers/mysql/8.0.26/.dockerignore @@ -0,0 +1,2 @@ +* +!workspace diff --git a/containers/mysql/8.0.26/Dockerfile b/containers/mysql/8.0.26/Dockerfile new file mode 100644 index 000000000..53b26451d --- /dev/null +++ b/containers/mysql/8.0.26/Dockerfile @@ -0,0 +1,40 @@ +FROM quay.io/cybozu/ubuntu-dev:22.04 AS builder + +ARG MYSQL_VERSION=8.0.26 + +RUN apt-get update && apt-get -y install --no-install-recommends \ + cmake \ + libncurses5-dev \ + libjemalloc-dev \ + libnuma-dev \ + libaio-dev \ + pkg-config + +RUN cd tmp/ \ + && curl -fsSL -O https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-${MYSQL_VERSION}.tar.gz \ + && tar -x -z -f mysql-boost-${MYSQL_VERSION}.tar.gz \ + && cd mysql-${MYSQL_VERSION} \ + && mkdir bld \ + && cd bld \ + && cmake .. -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=Release -DWITH_BOOST=$(ls -d ../boost/boost_*) -DWITH_NUMA=1 -DWITH_JEMALLOC=1 -DWITH_PACKAGE_FLAGS=0 \ + && make -j 20 \ + && make install + +FROM quay.io/cybozu/ubuntu:22.04 + +COPY --from=builder /usr/local/mysql/LICENSE /usr/local/mysql/LICENSE +COPY --from=builder /usr/local/mysql/bin /usr/local/mysql/bin +COPY --from=builder /usr/local/mysql/lib /usr/local/mysql/lib +COPY --from=builder /usr/local/mysql/share /usr/local/mysql/share + +RUN apt-get update \ + && apt-get install -y --no-install-recommends libjemalloc2 libnuma1 libaio1 \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /var/lib/mysql \ + && chown -R 10000:10000 /var/lib/mysql + +ENV PATH=/usr/local/mysql/bin:"$PATH" +VOLUME /var/lib/mysql +ENTRYPOINT ["mysqld"] +EXPOSE 3306 33060 33062 8080 +USER 10000:10000 diff --git a/containers/mysql/8.0.26/TAG b/containers/mysql/8.0.26/TAG new file mode 100644 index 000000000..8e0db108b --- /dev/null +++ b/containers/mysql/8.0.26/TAG @@ -0,0 +1 @@ +8.0.26.1 diff --git a/containers/mysql/8.0.27/.dockerignore b/containers/mysql/8.0.27/.dockerignore new file mode 100644 index 000000000..c1c4c64ec --- /dev/null +++ b/containers/mysql/8.0.27/.dockerignore @@ -0,0 +1,2 @@ +* +!workspace diff --git a/containers/mysql/8.0.27/Dockerfile b/containers/mysql/8.0.27/Dockerfile new file mode 100644 index 000000000..6c279e630 --- /dev/null +++ b/containers/mysql/8.0.27/Dockerfile @@ -0,0 +1,40 @@ +FROM quay.io/cybozu/ubuntu-dev:22.04 AS builder + +ARG MYSQL_VERSION=8.0.27 + +RUN apt-get update && apt-get -y install --no-install-recommends \ + cmake \ + libncurses5-dev \ + libjemalloc-dev \ + libnuma-dev \ + libaio-dev \ + pkg-config + +RUN cd tmp/ \ + && curl -fsSL -O https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-${MYSQL_VERSION}.tar.gz \ + && tar -x -z -f mysql-boost-${MYSQL_VERSION}.tar.gz \ + && cd mysql-${MYSQL_VERSION} \ + && mkdir bld \ + && cd bld \ + && cmake .. -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=Release -DWITH_BOOST=$(ls -d ../boost/boost_*) -DWITH_NUMA=1 -DWITH_JEMALLOC=1 -DWITH_PACKAGE_FLAGS=0 \ + && make -j 20 \ + && make install + +FROM quay.io/cybozu/ubuntu:22.04 + +COPY --from=builder /usr/local/mysql/LICENSE /usr/local/mysql/LICENSE +COPY --from=builder /usr/local/mysql/bin /usr/local/mysql/bin +COPY --from=builder /usr/local/mysql/lib /usr/local/mysql/lib +COPY --from=builder /usr/local/mysql/share /usr/local/mysql/share + +RUN apt-get update \ + && apt-get install -y --no-install-recommends libjemalloc2 libnuma1 libaio1 \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /var/lib/mysql \ + && chown -R 10000:10000 /var/lib/mysql + +ENV PATH=/usr/local/mysql/bin:"$PATH" +VOLUME /var/lib/mysql +ENTRYPOINT ["mysqld"] +EXPOSE 3306 33060 33062 8080 +USER 10000:10000 diff --git a/containers/mysql/8.0.27/TAG b/containers/mysql/8.0.27/TAG new file mode 100644 index 000000000..68bdae35c --- /dev/null +++ b/containers/mysql/8.0.27/TAG @@ -0,0 +1 @@ +8.0.27.1 diff --git a/containers/mysql/8.0.28/.dockerignore b/containers/mysql/8.0.28/.dockerignore new file mode 100644 index 000000000..c1c4c64ec --- /dev/null +++ b/containers/mysql/8.0.28/.dockerignore @@ -0,0 +1,2 @@ +* +!workspace diff --git a/containers/mysql/8.0.28/Dockerfile b/containers/mysql/8.0.28/Dockerfile new file mode 100644 index 000000000..5b01627ab --- /dev/null +++ b/containers/mysql/8.0.28/Dockerfile @@ -0,0 +1,40 @@ +FROM quay.io/cybozu/ubuntu-dev:22.04 AS builder + +ARG MYSQL_VERSION=8.0.28 + +RUN apt-get update && apt-get -y install --no-install-recommends \ + cmake \ + libncurses5-dev \ + libjemalloc-dev \ + libnuma-dev \ + libaio-dev \ + pkg-config + +RUN cd tmp/ \ + && curl -fsSL -O https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-${MYSQL_VERSION}.tar.gz \ + && tar -x -z -f mysql-boost-${MYSQL_VERSION}.tar.gz \ + && cd mysql-${MYSQL_VERSION} \ + && mkdir bld \ + && cd bld \ + && cmake .. -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=Release -DWITH_BOOST=$(ls -d ../boost/boost_*) -DWITH_NUMA=1 -DWITH_JEMALLOC=1 -DWITH_PACKAGE_FLAGS=0 \ + && make -j 20 \ + && make install + +FROM quay.io/cybozu/ubuntu:22.04 + +COPY --from=builder /usr/local/mysql/LICENSE /usr/local/mysql/LICENSE +COPY --from=builder /usr/local/mysql/bin /usr/local/mysql/bin +COPY --from=builder /usr/local/mysql/lib /usr/local/mysql/lib +COPY --from=builder /usr/local/mysql/share /usr/local/mysql/share + +RUN apt-get update \ + && apt-get install -y --no-install-recommends libjemalloc2 libnuma1 libaio1 \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /var/lib/mysql \ + && chown -R 10000:10000 /var/lib/mysql + +ENV PATH=/usr/local/mysql/bin:"$PATH" +VOLUME /var/lib/mysql +ENTRYPOINT ["mysqld"] +EXPOSE 3306 33060 33062 8080 +USER 10000:10000 diff --git a/containers/mysql/8.0.28/TAG b/containers/mysql/8.0.28/TAG new file mode 100644 index 000000000..d4cb69aec --- /dev/null +++ b/containers/mysql/8.0.28/TAG @@ -0,0 +1 @@ +8.0.28.1 diff --git a/containers/mysql/8.0.28/container-structure-test.yaml b/containers/mysql/8.0.28/container-structure-test.yaml new file mode 100644 index 000000000..b13360964 --- /dev/null +++ b/containers/mysql/8.0.28/container-structure-test.yaml @@ -0,0 +1,15 @@ +schemaVersion: '2.0.0' +fileExistenceTests: +- name: 'mysqld' + path: '/usr/local/mysql/bin/mysqld' + shouldExist: true + isExecutableBy: 'owner' +- name: 'mysql lib' + path: '/usr/local/mysql/lib' + shouldExist: true +- name: 'mysql share' + path: '/usr/local/mysql/share' + shouldExist: true +- name: 'mysql LICENSE' + path: '/usr/local/mysql/LICENSE' + shouldExist: true diff --git a/containers/mysql/8.0.30/.dockerignore b/containers/mysql/8.0.30/.dockerignore new file mode 100644 index 000000000..c1c4c64ec --- /dev/null +++ b/containers/mysql/8.0.30/.dockerignore @@ -0,0 +1,2 @@ +* +!workspace diff --git a/containers/mysql/8.0.30/Dockerfile b/containers/mysql/8.0.30/Dockerfile new file mode 100644 index 000000000..14fd4c43d --- /dev/null +++ b/containers/mysql/8.0.30/Dockerfile @@ -0,0 +1,40 @@ +FROM quay.io/cybozu/ubuntu-dev:22.04 AS builder + +ARG MYSQL_VERSION=8.0.30 + +RUN apt-get update && apt-get -y install --no-install-recommends \ + cmake \ + libncurses5-dev \ + libjemalloc-dev \ + libnuma-dev \ + libaio-dev \ + pkg-config + +RUN cd tmp/ \ + && curl -fsSL -O https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-${MYSQL_VERSION}.tar.gz \ + && tar -x -z -f mysql-boost-${MYSQL_VERSION}.tar.gz \ + && cd mysql-${MYSQL_VERSION} \ + && mkdir bld \ + && cd bld \ + && cmake .. -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=Release -DWITH_BOOST=$(ls -d ../boost/boost_*) -DWITH_NUMA=1 -DWITH_JEMALLOC=1 -DWITH_PACKAGE_FLAGS=0 \ + && make -j 20 \ + && make install + +FROM quay.io/cybozu/ubuntu:22.04 + +COPY --from=builder /usr/local/mysql/LICENSE /usr/local/mysql/LICENSE +COPY --from=builder /usr/local/mysql/bin /usr/local/mysql/bin +COPY --from=builder /usr/local/mysql/lib /usr/local/mysql/lib +COPY --from=builder /usr/local/mysql/share /usr/local/mysql/share + +RUN apt-get update \ + && apt-get install -y --no-install-recommends libjemalloc2 libnuma1 libaio1 \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /var/lib/mysql \ + && chown -R 10000:10000 /var/lib/mysql + +ENV PATH=/usr/local/mysql/bin:"$PATH" +VOLUME /var/lib/mysql +ENTRYPOINT ["mysqld"] +EXPOSE 3306 33060 33062 8080 +USER 10000:10000 diff --git a/containers/mysql/8.0.30/TAG b/containers/mysql/8.0.30/TAG new file mode 100644 index 000000000..3358bc8e7 --- /dev/null +++ b/containers/mysql/8.0.30/TAG @@ -0,0 +1 @@ +8.0.30.1 diff --git a/containers/mysql/8.0.30/container-structure-test.yaml b/containers/mysql/8.0.30/container-structure-test.yaml new file mode 100644 index 000000000..b13360964 --- /dev/null +++ b/containers/mysql/8.0.30/container-structure-test.yaml @@ -0,0 +1,15 @@ +schemaVersion: '2.0.0' +fileExistenceTests: +- name: 'mysqld' + path: '/usr/local/mysql/bin/mysqld' + shouldExist: true + isExecutableBy: 'owner' +- name: 'mysql lib' + path: '/usr/local/mysql/lib' + shouldExist: true +- name: 'mysql share' + path: '/usr/local/mysql/share' + shouldExist: true +- name: 'mysql LICENSE' + path: '/usr/local/mysql/LICENSE' + shouldExist: true diff --git a/containers/mysql/8.0.31/.dockerignore b/containers/mysql/8.0.31/.dockerignore new file mode 100644 index 000000000..c1c4c64ec --- /dev/null +++ b/containers/mysql/8.0.31/.dockerignore @@ -0,0 +1,2 @@ +* +!workspace diff --git a/containers/mysql/8.0.31/Dockerfile b/containers/mysql/8.0.31/Dockerfile new file mode 100644 index 000000000..162a489ca --- /dev/null +++ b/containers/mysql/8.0.31/Dockerfile @@ -0,0 +1,40 @@ +FROM quay.io/cybozu/ubuntu-dev:22.04 AS builder + +ARG MYSQL_VERSION=8.0.31 + +RUN apt-get update && apt-get -y install --no-install-recommends \ + cmake \ + libncurses5-dev \ + libjemalloc-dev \ + libnuma-dev \ + libaio-dev \ + pkg-config + +RUN cd tmp/ \ + && curl -fsSL -O https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-${MYSQL_VERSION}.tar.gz \ + && tar -x -z -f mysql-boost-${MYSQL_VERSION}.tar.gz \ + && cd mysql-${MYSQL_VERSION} \ + && mkdir bld \ + && cd bld \ + && cmake .. -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=Release -DWITH_BOOST=$(ls -d ../boost/boost_*) -DWITH_NUMA=1 -DWITH_JEMALLOC=1 -DWITH_PACKAGE_FLAGS=0 \ + && make -j 20 \ + && make install + +FROM quay.io/cybozu/ubuntu:22.04 + +COPY --from=builder /usr/local/mysql/LICENSE /usr/local/mysql/LICENSE +COPY --from=builder /usr/local/mysql/bin /usr/local/mysql/bin +COPY --from=builder /usr/local/mysql/lib /usr/local/mysql/lib +COPY --from=builder /usr/local/mysql/share /usr/local/mysql/share + +RUN apt-get update \ + && apt-get install -y --no-install-recommends libjemalloc2 libnuma1 libaio1 \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /var/lib/mysql \ + && chown -R 10000:10000 /var/lib/mysql + +ENV PATH=/usr/local/mysql/bin:"$PATH" +VOLUME /var/lib/mysql +ENTRYPOINT ["mysqld"] +EXPOSE 3306 33060 33062 8080 +USER 10000:10000 diff --git a/containers/mysql/8.0.31/TAG b/containers/mysql/8.0.31/TAG new file mode 100644 index 000000000..774509edc --- /dev/null +++ b/containers/mysql/8.0.31/TAG @@ -0,0 +1 @@ +8.0.31.1 diff --git a/containers/mysql/8.0.31/container-structure-test.yaml b/containers/mysql/8.0.31/container-structure-test.yaml new file mode 100644 index 000000000..b13360964 --- /dev/null +++ b/containers/mysql/8.0.31/container-structure-test.yaml @@ -0,0 +1,15 @@ +schemaVersion: '2.0.0' +fileExistenceTests: +- name: 'mysqld' + path: '/usr/local/mysql/bin/mysqld' + shouldExist: true + isExecutableBy: 'owner' +- name: 'mysql lib' + path: '/usr/local/mysql/lib' + shouldExist: true +- name: 'mysql share' + path: '/usr/local/mysql/share' + shouldExist: true +- name: 'mysql LICENSE' + path: '/usr/local/mysql/LICENSE' + shouldExist: true diff --git a/containers/mysql/8.0.32/.dockerignore b/containers/mysql/8.0.32/.dockerignore new file mode 100644 index 000000000..72e8ffc0d --- /dev/null +++ b/containers/mysql/8.0.32/.dockerignore @@ -0,0 +1 @@ +* diff --git a/containers/mysql/8.0.32/Dockerfile b/containers/mysql/8.0.32/Dockerfile new file mode 100644 index 000000000..fed7909f5 --- /dev/null +++ b/containers/mysql/8.0.32/Dockerfile @@ -0,0 +1,40 @@ +FROM quay.io/cybozu/ubuntu-dev:22.04 AS builder + +ARG MYSQL_VERSION=8.0.32 + +RUN apt-get update && apt-get -y install --no-install-recommends \ + cmake \ + libncurses5-dev \ + libjemalloc-dev \ + libnuma-dev \ + libaio-dev \ + pkg-config + +RUN cd tmp/ \ + && curl -fsSL -O https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-${MYSQL_VERSION}.tar.gz \ + && tar -x -z -f mysql-boost-${MYSQL_VERSION}.tar.gz \ + && cd mysql-${MYSQL_VERSION} \ + && mkdir bld \ + && cd bld \ + && cmake .. -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=Release -DWITH_BOOST=$(ls -d ../boost/boost_*) -DWITH_NUMA=1 -DWITH_JEMALLOC=1 -DWITH_PACKAGE_FLAGS=0 \ + && make -j 20 \ + && make install + +FROM quay.io/cybozu/ubuntu:22.04 + +COPY --from=builder /usr/local/mysql/LICENSE /usr/local/mysql/LICENSE +COPY --from=builder /usr/local/mysql/bin /usr/local/mysql/bin +COPY --from=builder /usr/local/mysql/lib /usr/local/mysql/lib +COPY --from=builder /usr/local/mysql/share /usr/local/mysql/share + +RUN apt-get update \ + && apt-get install -y --no-install-recommends libjemalloc2 libnuma1 libaio1 \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /var/lib/mysql \ + && chown -R 10000:10000 /var/lib/mysql + +ENV PATH=/usr/local/mysql/bin:"$PATH" +VOLUME /var/lib/mysql +ENTRYPOINT ["mysqld"] +EXPOSE 3306 33060 33062 8080 +USER 10000:10000 diff --git a/containers/mysql/8.0.32/TAG b/containers/mysql/8.0.32/TAG new file mode 100644 index 000000000..7d85f56b2 --- /dev/null +++ b/containers/mysql/8.0.32/TAG @@ -0,0 +1 @@ +8.0.32.1 diff --git a/containers/mysql/8.0.32/container-structure-test.yaml b/containers/mysql/8.0.32/container-structure-test.yaml new file mode 100644 index 000000000..b13360964 --- /dev/null +++ b/containers/mysql/8.0.32/container-structure-test.yaml @@ -0,0 +1,15 @@ +schemaVersion: '2.0.0' +fileExistenceTests: +- name: 'mysqld' + path: '/usr/local/mysql/bin/mysqld' + shouldExist: true + isExecutableBy: 'owner' +- name: 'mysql lib' + path: '/usr/local/mysql/lib' + shouldExist: true +- name: 'mysql share' + path: '/usr/local/mysql/share' + shouldExist: true +- name: 'mysql LICENSE' + path: '/usr/local/mysql/LICENSE' + shouldExist: true diff --git a/containers/mysql/README.md b/containers/mysql/README.md new file mode 100644 index 000000000..3ce196038 --- /dev/null +++ b/containers/mysql/README.md @@ -0,0 +1,14 @@ +# MySQL container + +This directory provides a Dockerfile to build a MySQL container for [MOCO](https://github.com/cybozu-go/moco). +This also provides `moco-init` command to initialize MySQL data for MOCO. + +## MOCO MySQL container + +### Usage + +This container image is assumed to be used by [MOCO](https://github.com/cybozu-go/moco). + +### Docker images + +Docker images are available on [Quay.io](https://quay.io/repository/cybozu/mysql).