Skip to content

Commit

Permalink
Upgrade mysql to 8.0.31 (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay authored Feb 13, 2023
1 parent 210c13f commit b68a1b7
Show file tree
Hide file tree
Showing 65 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion 5.7/base_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.7.38
5.7.41
20 changes: 16 additions & 4 deletions 8.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
FROM ubuntu:20.04 as base
ARG XTRABACKUP_PACKAGE_VERSION
ARG MYSQL_PACKAGE_VERSION
ARG TARGETPLATFORM
SHELL ["/bin/bash", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-c"]

# Pin the versions of mysql-server and percona-xtrabackup80 to the versions
# in /files (which must be updated)
COPY /files/mysql-server /etc/apt/preferences.d
COPY /files/percona-xtrabackup80 /etc/apt/preferences.d

RUN apt-get -qq update >/dev/null && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y -o Dpkg::Options::="--force-confold" curl libcurl4-openssl-dev libev-dev libdbd-mysql-perl lsb-release mysql-server rsync wget >/dev/null
RUN apt-get -qq update >/dev/null && apt-get -qq install -y -o Dpkg::Options::="--force-confold" curl libcurl4-openssl-dev >/dev/null

RUN apt install -y mysql-server >/dev/null || apt-get install -y mysql-server --fix-missing --fix-broken >/dev/null
ADD /mysql-8.0.31 /tmp
RUN ls -lR /tmp

RUN apt-get install -y --allow-downgrades -o Dpkg::Options::="--force-confnew" --no-install-recommends --no-install-suggests /tmp/archives-${TARGETPLATFORM#linux/}/*.deb >/dev/null

RUN apt-get -qq install -y -o Dpkg::Options::="--force-confold" libdbd-mysql-perl libev4 rsync wget >/dev/null

RUN rm -rf /tmp/archives*

# If xtrabackup has been built into this repo, copy it in
# But that will be arm64, so we'll delete it if we're on amd64
COPY /files/install/lib* /usr/local
COPY /files/install/bin* /usr/local

SHELL ["/bin/bash", "-c"]

# xtrabackup-8.0 should always be installed, then ddev-dbserver won't have to install it.
# If on amd64 we'll get it from percona package
# https://downloads.percona.com/downloads/Percona-XtraBackup-8.0/Percona-XtraBackup-8.0.31-24/binary/debian/buster/x86_64/percona-xtrabackup-80_8.0.31-24-1.buster_amd64.deb
RUN if [ "$(arch)" = "x86_64" ]; then \
set -eu -o pipefail; \
rm -f /usr/local/bin/xb* /usr/local/bin/xtrabackup* /usr/local/lib/libmysqlservices.a ; \
curl --fail -o /tmp/xtrabackup.deb https://downloads.percona.com/downloads/Percona-XtraBackup-LATEST/Percona-XtraBackup-${XTRABACKUP_PACKAGE_VERSION%-*}/binary/debian/focal/x86_64/percona-xtrabackup-80_${XTRABACKUP_PACKAGE_VERSION}.focal_amd64.deb && \
curl -s -L --fail -o /tmp/xtrabackup.deb https://downloads.percona.com/downloads/Percona-XtraBackup-8.0/Percona-XtraBackup-${XTRABACKUP_PACKAGE_VERSION%-*}/binary/debian/focal/x86_64/percona-xtrabackup-80_${XTRABACKUP_PACKAGE_VERSION}.focal_amd64.deb && \
dpkg -i /tmp/xtrabackup.deb >/dev/null && \
rm /tmp/xtrabackup.deb ; \
fi
Expand Down
2 changes: 1 addition & 1 deletion 8.0/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ XTRABACKUP_PACKAGE_VERSION=$(cat xtrabackup_version.txt)

set -x
# Build only current architecture and load into docker
docker buildx build --build-arg=XTRABACKUP_PACKAGE_VERSION="${XTRABACKUP_PACKAGE_VERSION}" --build-arg="MYSQL_PACKAGE_VERSION=${MYSQL_PACKAGE_VERSION}" --target=mysql -t ${REPO_NAME}:${MYSQL_MAJOR} -t ${REPO_NAME}:${MYSQL_MINOR} .
docker buildx build --progress plain --no-cache --build-arg=XTRABACKUP_PACKAGE_VERSION="${XTRABACKUP_PACKAGE_VERSION}" --build-arg="MYSQL_PACKAGE_VERSION=${MYSQL_PACKAGE_VERSION}" --target=mysql -t ${REPO_NAME}:${MYSQL_MAJOR} -t ${REPO_NAME}:${MYSQL_MINOR} .
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion 8.0/mysql_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.0.29
8.0.31
2 changes: 1 addition & 1 deletion 8.0/xtrabackup_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.0.29-22-1
8.0.31-24-1
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Oracle does not publish any arm64 images for mysql, but people on mac M1 ([ddev]

This repo is used for publishing those images.

## Preparation

Because mysql-server-8.0 is usually ahead of the released xtrabackup version, it's important to capture the mysql-server and mysql-client deb files ahead of time, when we're expecting a new xtrabackup version.

To do this, for both PLATFORM=linux/amd64 and PLATFORM=linux/arm64, `docker run -it --platform=$PLATFORM --rm ubuntu:20.04 bash` and `apt update && apt upgrade -y && apt install -y mysql-server` and then remove all that with `apt remove mysql-server mysql-client && apt autoremove`. This should put the system in position where the exact needed items will be downloaded with `apt install -y --download-only mysql-server-8.0`, after which all the need .deb files will be in /var/cache/apt/archives and they can be updated into the replacement of mysql-8.0.31

## Building and pushing

* Push both with ./push.sh in the top-level directory or
Expand Down

0 comments on commit b68a1b7

Please sign in to comment.