1
0
mirror of https://github.com/MariaDB/mariadb-docker.git synced 2025-04-19 06:02:18 +03:00

purge of noble ubuntu user

Some users depend on a groupid of 1000 as empty.

Its not really used by us so lets remove the entire
ubuntu user and the ubuntu group that came with it.

e.g; https://github.com/FREVA-CLINT/freva/pull/204
This commit is contained in:
Daniel Black 2024-06-20 18:15:21 +10:00
parent aecdf2e613
commit fb46c56626
5 changed files with 12 additions and 5 deletions

View File

@ -2,7 +2,7 @@
FROM ubuntu:noble
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r mysql && useradd -r -g mysql mysql --home-dir /var/lib/mysql
RUN groupadd -r mysql && useradd -r -g mysql mysql --home-dir /var/lib/mysql && userdel --remove ubuntu
# add gosu for easy step-down from root
# https://github.com/tianon/gosu/releases

View File

@ -2,7 +2,7 @@
FROM ubuntu:noble
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r mysql && useradd -r -g mysql mysql --home-dir /var/lib/mysql
RUN groupadd -r mysql && useradd -r -g mysql mysql --home-dir /var/lib/mysql && userdel --remove ubuntu
# add gosu for easy step-down from root
# https://github.com/tianon/gosu/releases

View File

@ -2,7 +2,7 @@
FROM ubuntu:noble
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r mysql && useradd -r -g mysql mysql --home-dir /var/lib/mysql
RUN groupadd -r mysql && useradd -r -g mysql mysql --home-dir /var/lib/mysql && userdel --remove ubuntu
# add gosu for easy step-down from root
# https://github.com/tianon/gosu/releases

View File

@ -2,7 +2,7 @@
FROM ubuntu:%%SUITE%%
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r mysql && useradd -r -g mysql mysql --home-dir /var/lib/mysql
RUN groupadd -r mysql && useradd -r -g mysql mysql --home-dir /var/lib/mysql && userdel --remove ubuntu
# add gosu for easy step-down from root
# https://github.com/tianon/gosu/releases

View File

@ -105,7 +105,9 @@ update_version()
-e '/memory\.pressure/,+7d' "$dir/docker-entrypoint.sh"
sed -i -e '/--skip-ssl/d' \
-e '0,/#ENDOFSUBSTITUTIONS/s/\tmariadb/\tmysql/' "$dir/healthcheck.sh"
sed -i -e '/^CMD/s/mariadbd/mysqld/' "$dir/Dockerfile"
sed -i -e '/^CMD/s/mariadbd/mysqld/' \
-e 's/ && userdel.*//' \
"$dir/Dockerfile"
sed -i -e 's/mariadb_upgrade_info/mysql_upgrade_info/' \
"$dir/docker-entrypoint.sh" "$dir/healthcheck.sh"
;;
@ -116,6 +118,8 @@ update_version()
sed -i -e '/--skip-ssl/d' "$dir/docker-entrypoint.sh" "$dir/healthcheck.sh"
sed -i -e 's/mariadb_upgrade_info/mysql_upgrade_info/' \
"$dir/docker-entrypoint.sh" "$dir/healthcheck.sh"
sed -i -e 's/ && userdel.*//' \
"$dir/Dockerfile"
;;
10.11)
sed -i -e 's/mariadb_upgrade_info/mysql_upgrade_info/' \
@ -126,6 +130,7 @@ update_version()
sed -i -e '/^ARG MARIADB_MAJOR/d' \
-e '/^ENV MARIADB_MAJOR/d' \
-e 's/-\$MARIADB_MAJOR//' \
-e 's/ && userdel.*//' \
"$dir/Dockerfile"
;;
*)
@ -138,6 +143,8 @@ update_version()
if [[ $vmin =~ 11.[12] ]]; then
sed -i -e '/--skip-ssl/d' \
"$dir/docker-entrypoint.sh" "$dir/healthcheck.sh"
sed -i -e 's/ && userdel.*//' \
"$dir/Dockerfile"
fi
if [ "$vmin" == 11.1 ]; then
sed -i -e 's/50-mysqld_safe.cnf/50-mariadb_safe.cnf/' "$dir/Dockerfile"