forked from pool/mariadb-image
Compare commits
41 Commits
Author | SHA256 | Date | |
---|---|---|---|
d3a52bc215 | |||
fb353dc792 | |||
8ba10883ff | |||
9b9288b01a | |||
d031653357 | |||
e60ab147d6 | |||
593384022d | |||
bef1dde1c6 | |||
5b01461235 | |||
49d2283a9c | |||
9da1f23188 | |||
d2d2620da1 | |||
c6ff621ca2 | |||
46748f3b71 | |||
71a6d96b3d | |||
5e5a36fbed | |||
461deef316 | |||
c8dc9cf577 | |||
aaba089e7a | |||
48a661f2e6 | |||
816675ead3 | |||
bd39b710d3 | |||
5149294ddb | |||
910bcb53fe | |||
434c2196fe | |||
1353eb4025 | |||
34bee20e49 | |||
67b32dbff1 | |||
e523fb9662 | |||
759bcad89b | |||
96b7307cf4 | |||
f73000355e | |||
9de1d275bb | |||
b15f423b09 | |||
1522c30916 | |||
73b5694298 | |||
40591d26b6 | |||
c1a69ba0c3 | |||
2ba1ae4320 | |||
9e8ac71a69 | |||
ad4ee62ba5 |
46
Dockerfile
46
Dockerfile
@@ -1,6 +1,6 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -13,27 +13,38 @@
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
# You can contact the BCI team via https://github.com/SUSE/bci/discussions
|
||||
|
||||
|
||||
#!BuildTag: opensuse/mariadb:11.4
|
||||
#!BuildTag: opensuse/mariadb:11.4-%RELEASE%
|
||||
#!UseOBSRepositories
|
||||
#!ExclusiveArch: aarch64 ppc64le s390x x86_64
|
||||
#!BuildTag: opensuse/mariadb:%%mariadb_version%%-%RELEASE%
|
||||
#!BuildTag: opensuse/mariadb:%%mariadb_version%%
|
||||
#!BuildTag: opensuse/mariadb:11.7
|
||||
#!BuildTag: opensuse/mariadb:latest
|
||||
|
||||
FROM opensuse/tumbleweed:latest
|
||||
|
||||
RUN set -euo pipefail; zypper -n in --no-recommends mariadb mariadb-tools gawk timezone util-linux findutils; zypper -n clean; rm -rf /var/log/{lastlog,tallylog,zypper.log,zypp/history,YaST2}
|
||||
FROM opensuse/bci/bci-micro:latest AS target
|
||||
FROM opensuse/tumbleweed:latest AS builder
|
||||
COPY --from=target / /target
|
||||
|
||||
RUN set -euo pipefail; \
|
||||
zypper -n --installroot /target --gpg-auto-import-keys install --no-recommends coreutils findutils gawk mariadb mariadb-tools openssl sed timezone util-linux zstd; \
|
||||
zypper -n clean; \
|
||||
rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}
|
||||
# sanity check that the version from the tag is equal to the version of mariadb that we expect
|
||||
RUN set -euo pipefail; \
|
||||
[ "$(rpm --root /target -q --qf '%{version}' mariadb | \
|
||||
cut -d '.' -f -2)" = "11.7" ]
|
||||
FROM opensuse/bci/bci-micro:latest
|
||||
COPY --from=builder /target /
|
||||
# Define labels according to https://en.opensuse.org/Building_derived_containers
|
||||
# labelprefix=org.opensuse.application.mariadb
|
||||
LABEL org.opencontainers.image.authors="openSUSE (https://www.opensuse.org/)"
|
||||
LABEL org.opencontainers.image.title="openSUSE Tumbleweed MariaDB Server"
|
||||
LABEL org.opencontainers.image.description="MariaDB Server container based on the openSUSE Tumbleweed Base Container Image."
|
||||
LABEL org.opencontainers.image.version="11.4"
|
||||
LABEL org.opencontainers.image.version="%%mariadb_version%%"
|
||||
LABEL org.opencontainers.image.url="https://www.opensuse.org"
|
||||
LABEL org.opencontainers.image.created="%BUILDTIME%"
|
||||
LABEL org.opencontainers.image.vendor="openSUSE Project"
|
||||
LABEL org.opencontainers.image.source="%SOURCEURL%"
|
||||
LABEL org.opencontainers.image.ref.name="11.4-%RELEASE%"
|
||||
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/mariadb:11.4-%RELEASE%"
|
||||
LABEL org.opencontainers.image.ref.name="%%mariadb_version%%-%RELEASE%"
|
||||
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/mariadb:%%mariadb_version%%-%RELEASE%"
|
||||
LABEL org.openbuildservice.disturl="%DISTURL%"
|
||||
LABEL org.opensuse.lifecycle-url="https://en.opensuse.org/Lifetime#openSUSE_BCI"
|
||||
LABEL org.opensuse.release-stage="released"
|
||||
@@ -41,10 +52,7 @@ LABEL org.opensuse.release-stage="released"
|
||||
LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/SUSE/BCI-dockerfile-generator/Tumbleweed/mariadb-image/README.md"
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
CMD ["mariadbd"]
|
||||
EXPOSE 3306
|
||||
# sanity check that the version from the tag is equal to the version of mariadb-client that we expect
|
||||
RUN set -euo pipefail; [ "$(rpm -q --qf '%{version}' mariadb-client | cut -d '.' -f -2)" = "11.4" ]
|
||||
|
||||
EXPOSE 3306/tcp
|
||||
RUN set -euo pipefail; mkdir /docker-entrypoint-initdb.d
|
||||
|
||||
# docker-entrypoint from https://github.com/MariaDB/mariadb-docker.git
|
||||
@@ -56,8 +64,12 @@ RUN set -euo pipefail; ln -s usr/local/bin/docker-entrypoint.sh / # backwards co
|
||||
COPY healthcheck.sh /usr/local/bin/
|
||||
RUN set -euo pipefail; chmod 755 /usr/local/bin/healthcheck.sh
|
||||
|
||||
COPY gosu /usr/local/bin/gosu
|
||||
RUN set -euo pipefail; chmod 755 /usr/local/bin/gosu
|
||||
COPY idexec /usr/local/bin/idexec
|
||||
RUN set -euo pipefail; chmod 755 /usr/local/bin/idexec
|
||||
|
||||
# replace gosu calls with idexec
|
||||
RUN set -euo pipefail; sed -i 's/exec gosu /exec idexec /g' /usr/local/bin/docker-entrypoint.sh
|
||||
RUN set -euo pipefail; sed -i 's/exec gosu /exec idexec /g' /usr/local/bin/healthcheck.sh
|
||||
|
||||
RUN set -euo pipefail; sed -i -e 's,$(pwgen .*),$(openssl rand -base64 36),' /usr/local/bin/docker-entrypoint.sh
|
||||
|
||||
|
@@ -12,13 +12,13 @@ By default, the image launches MariaDB with the same configuration that comes wi
|
||||
The only environment variable required to start the container is the MariaDB root password.
|
||||
|
||||
```ShellSession
|
||||
$ podman run -it --rm -p 3306:3306 -e MARIADB_ROOT_PASSWORD=my-password registry.opensuse.org/opensuse/mariadb:11.4
|
||||
$ podman run -it --rm -p 3306:3306 -e MARIADB_ROOT_PASSWORD=my-password registry.opensuse.org/opensuse/mariadb:11.7
|
||||
```
|
||||
|
||||
or:
|
||||
|
||||
```ShellSession
|
||||
$ podman run -it --rm -p 3306:3306 -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1 registry.opensuse.org/opensuse/mariadb:11.4
|
||||
$ podman run -it --rm -p 3306:3306 -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1 registry.opensuse.org/opensuse/mariadb:11.7
|
||||
```
|
||||
|
||||
### Volumes
|
||||
@@ -33,7 +33,7 @@ When using the MariaDB image, we recommend one of the following options:
|
||||
To mount a host directory as a volume for your data run the following command:
|
||||
|
||||
```ShellSession
|
||||
$ podman run -it --rm -v /my/own/datadir:/var/lib/mysql:Z -p 3306:3306 -e MARIADB_ROOT_PASSWORD=my-password registry.opensuse.org/opensuse/mariadb:11.4
|
||||
$ podman run -it --rm -v /my/own/datadir:/var/lib/mysql:Z -p 3306:3306 -e MARIADB_ROOT_PASSWORD=my-password registry.opensuse.org/opensuse/mariadb:11.7
|
||||
```
|
||||
|
||||
The `-v /my/own/datadir:/var/lib/mysql:Z` part of the command mounts the `/my/own/datadir` directory from the underlying host system as `/var/lib/mysql` inside the container, where MariaDB will by default write its data files.
|
||||
|
7
_service
7
_service
@@ -1,10 +1,15 @@
|
||||
<services>
|
||||
<service mode="buildtime" name="docker_label_helper"/>
|
||||
<service mode="buildtime" name="kiwi_metainfo_helper"/>
|
||||
<service name="replace_using_package_version" mode="buildtime">
|
||||
<service mode="buildtime" name="replace_using_package_version">
|
||||
<param name="file">docker-entrypoint.sh</param>
|
||||
<param name="regex">%%mariadb_version%%</param>
|
||||
<param name="package">mariadb</param>
|
||||
<param name="parse-version">patch</param>
|
||||
</service>
|
||||
<service mode="buildtime" name="replace_using_package_version">
|
||||
<param name="file">Dockerfile</param>
|
||||
<param name="regex">%%mariadb_version%%</param>
|
||||
<param name="package">mariadb</param>
|
||||
</service>
|
||||
</services>
|
@@ -121,6 +121,7 @@ mysql_get_config() {
|
||||
docker_temp_server_start() {
|
||||
"$@" --skip-networking --default-time-zone=SYSTEM --socket="${SOCKET}" --wsrep_on=OFF \
|
||||
--expire-logs-days=0 \
|
||||
--skip-slave-start \
|
||||
--loose-innodb_buffer_pool_load_at_startup=0 \
|
||||
--skip-ssl --ssl-cert='' --ssl-key='' --ssl-ca='' \
|
||||
&
|
||||
@@ -460,7 +461,6 @@ docker_setup_db() {
|
||||
# To create replica user
|
||||
local createReplicaUser=
|
||||
local changeMasterTo=
|
||||
local startReplica=
|
||||
if [ -n "$MARIADB_REPLICATION_USER" ] ; then
|
||||
if [ -z "$MARIADB_MASTER_HOST" ]; then
|
||||
# on master
|
||||
@@ -473,7 +473,6 @@ docker_setup_db() {
|
||||
# SC cannot follow how MARIADB_MASTER_PORT is assigned a default value.
|
||||
# shellcheck disable=SC2153
|
||||
changeMasterTo="CHANGE MASTER TO MASTER_HOST='$MARIADB_MASTER_HOST', MASTER_USER='$MARIADB_REPLICATION_USER', MASTER_PASSWORD='$rplPasswordEscaped', MASTER_PORT=$MARIADB_MASTER_PORT, MASTER_CONNECT_RETRY=10;"
|
||||
startReplica="START REPLICA;"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -504,7 +503,6 @@ docker_setup_db() {
|
||||
${userGrants}
|
||||
|
||||
${changeMasterTo}
|
||||
${startReplica}
|
||||
EOSQL
|
||||
}
|
||||
|
||||
@@ -600,8 +598,7 @@ docker_mariadb_upgrade() {
|
||||
fi
|
||||
mysql_note "Starting temporary server"
|
||||
docker_temp_server_start "$@" --skip-grant-tables \
|
||||
--loose-innodb_buffer_pool_dump_at_shutdown=0 \
|
||||
--skip-slave-start
|
||||
--loose-innodb_buffer_pool_dump_at_shutdown=0
|
||||
mysql_note "Temporary server started."
|
||||
|
||||
docker_mariadb_backup_system
|
||||
@@ -626,8 +623,7 @@ EOSQL
|
||||
# need a restart as FLUSH PRIVILEGES isn't reversable
|
||||
mysql_note "Restarting temporary server for upgrade"
|
||||
docker_temp_server_start "$@" --skip-grant-tables \
|
||||
--loose-innodb_buffer_pool_dump_at_shutdown=0 \
|
||||
--skip-slave-start
|
||||
--loose-innodb_buffer_pool_dump_at_shutdown=0
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
|
@@ -363,6 +363,11 @@ while [ $# -gt 0 ]; do
|
||||
fi
|
||||
nodefaults=
|
||||
;;
|
||||
--no-connect)
|
||||
# used for /docker-entrypoint-initdb.d scripts
|
||||
# where you definately don't want a connection test
|
||||
connect_s=0
|
||||
;;
|
||||
--*)
|
||||
test=${1#--}
|
||||
;;
|
||||
|
@@ -8,4 +8,4 @@ if ! id -u "$u" > /dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec setpriv --reuid="$u" --regid="$u" --clear-groups -- "$@"
|
||||
exec setpriv --pdeathsig=keep --reuid="$u" --regid="$u" --clear-groups -- "$@"
|
@@ -1,3 +1,98 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 21 10:12:28 UTC 2025 - SUSE Update Bot <bci-internal@suse.de>
|
||||
|
||||
- Bump mariadb version to 11.7
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 31 13:55:15 UTC 2025 - SUSE Update Bot <bci-internal@suse.de>
|
||||
|
||||
- set exclusivearch to exclude 32bit platforms from building
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 1 14:13:48 UTC 2025 - SUSE Update Bot <bci-internal@suse.de>
|
||||
|
||||
- update copyright year
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 12 18:21:50 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||
|
||||
- rename gosu binary
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Dec 3 13:26:37 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||
|
||||
- Change attribute order in _service
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 25 11:56:07 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||
|
||||
- Switch to a multistage build and base the final image on micro
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 18 09:27:58 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||
|
||||
- update to 11.6 mariadb
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 12 15:34:21 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||
|
||||
- update entrypoint from upstream
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 30 18:28:27 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||
|
||||
- be explicit in protocol for expose statement
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 30 15:34:45 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||
|
||||
- remove nonsensical org.opencontainers.image.authors - duplication of .vendor
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Oct 29 15:23:20 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||
|
||||
- drop tag_version-%RELEASE%
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 14 11:26:26 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||
|
||||
- make the version-%release tag the first one listed; remove duplicates where they existed; update image.ref/reference to point to the version-%release(-) tag
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 11 15:12:52 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>
|
||||
|
||||
- make the tag with -%RELEASE% the first tag listed
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 25 17:36:16 UTC 2024 - Dirk Mueller <dmueller@suse.com>
|
||||
|
||||
- rerender installation step in multiple lines, allow uninstalling optional packages
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 25 17:12:11 UTC 2024 - Dirk Mueller <dmueller@suse.com>
|
||||
|
||||
- improved log cleaning
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 12 10:37:22 UTC 2024 - Dirk Mueller <dmueller@suse.com>
|
||||
|
||||
- set useobsrepositories explicitly
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 12 06:35:48 UTC 2024 - Dirk Mueller <dmueller@suse.com>
|
||||
|
||||
- set full version in labels of mariadb* container
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 9 13:54:45 UTC 2024 - Madhankumar Chellamuthu <madhankumar.chellamuthu@suse.com>
|
||||
|
||||
- add zstd for the upgrade scenario and fix signal handling
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 9 06:51:05 UTC 2024 - Dirk Mueller <dmueller@suse.com>
|
||||
|
||||
- Bump main package version
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 4 11:25:11 UTC 2024 - Dan Čermák <dcermak@suse.com>
|
||||
|
||||
|
Reference in New Issue
Block a user