Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions library/percona-xtrabackup/8.4.0-5/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
FROM cr.loongnix.cn/library/mysql:8.4.8 AS prepare

RUN yum -y update && \
yum -y install wget && \
yum clean all

RUN wget -O /tmp/percona-xtrabackup-8.4.0.tar.gz http://cloud.loongnix.cn/releases/loongarch64abi1/percona%2Fpercona-xtrabackup%2F8.4.0-5/percona-xtrabackup-8.4.0-linux-loongarch64.tar.gz && \
mkdir -p /opt/percona-xtrabackup && \
tar -xzf /tmp/percona-xtrabackup-8.4.0.tar.gz -C /opt/percona-xtrabackup --strip-component=1 && \
rm -f /tmp/percona-xtrabackup-8.4.0.tar.gz


FROM cr.loongnix.cn/loongson/loongnix-server:8.4

RUN yum -y update && \
yum -y install \
glibc-langpack-en \
tar \
unzip \
shadow-utils \
socat \
hostname \
jq \
procps-ng \
lz4 \
zstd \
ncurses-libs \
libev \
libaio \
devtoolset-10-libstdc++ && \
yum clean all

RUN ln -sf /opt/rh/devtoolset-10/root/usr/lib/libstdc++.so.6 /lib64/libstdc++.so.6
RUN groupadd -g 1001 mysql && \
useradd -u 1001 -r -g 1001 -s /sbin/nologin \
-c "Default Application User" mysql

COPY --from=prepare /usr/bin/mysql /usr/bin/mysql
COPY --from=prepare /usr/bin/mysqlbinlog /usr/bin/mysqlbinlog
COPY --from=prepare /opt/percona-xtrabackup /usr/local/percona-xtrabackup
RUN chmod +x /usr/bin/mysql /usr/bin/mysqlbinlog
ENV PATH=/usr/local/percona-xtrabackup/bin:$PATH

RUN install -d -o 1001 -g 0 -m 0775 /backup
WORKDIR /backup

COPY pxb-entry.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh

VOLUME [ "/backup" ]
USER 1001
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["xtrabackup"]
18 changes: 18 additions & 0 deletions library/percona-xtrabackup/8.4.0-5/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is generated by the template.

REGISTRY ?= cr.loongnix.cn
ORGANIZATION ?= library
REPOSITORY ?= percona-xtrabackup
TAG ?= 8.4.0-5

IMAGE = $(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG)

default: image

image:
docker build \
-t $(IMAGE) \
.

push:
docker push $(IMAGE)
28 changes: 28 additions & 0 deletions library/percona-xtrabackup/8.4.0-5/pxb-entry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
set -eo pipefail
shopt -s nullglob

if [ ! -z "${PERCONA_INSTANCE_ID}" ]; then
CALL_HOME_OPTIONAL_PARAMS+=" -i ${PERCONA_INSTANCE_ID}"
fi

if [ ! -z "${PERCONA_TELEMETRY_CONFIG_FILE_PATH}" ]; then
CALL_HOME_OPTIONAL_PARAMS+=" -j ${PERCONA_TELEMETRY_CONFIG_FILE_PATH}"
fi

if [ ! -z "${PERCONA_SEND_TIMEOUT}" ]; then
CALL_HOME_OPTIONAL_PARAMS+=" -t ${PERCONA_SEND_TIMEOUT}"
else
CALL_HOME_OPTIONAL_PARAMS+=" -t 7"
fi

if [ ! -z "${PERCONA_CONNECT_TIMEOUT}" ]; then
CALL_HOME_OPTIONAL_PARAMS+=" -c ${PERCONA_CONNECT_TIMEOUT}"
else
CALL_HOME_OPTIONAL_PARAMS+=" -c 2"
fi

# phase-0 telemetry
/call-home.sh -f "PRODUCT_FAMILY_PXB" -v "${PXB_TELEMETRY_VERSION}" -d "DOCKER" ${CALL_HOME_OPTIONAL_PARAMS} &> /dev/null || :

exec "$@"
Loading