From 6ae93e74482a0385013fc3ce1c379d2d915d75cf Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Thu, 16 Jan 2025 16:05:13 +0100 Subject: [PATCH] Enhance 'chown' call 1) Use common ':' separator instead of unusual '.' one, as disscussed here: https://github.com/sclorg/mariadb-container/pull/262#discussion_r1916127433 2) Use the same data type in the whole expression, so either only integers '27:0' or preferably only strings 'mysql:root' as suggested here: https://github.com/sclorg/mariadb-container/pull/262#discussion_r1916424440 --- 10.11/Dockerfile.c10s | 2 +- 10.11/Dockerfile.c8s | 2 +- 10.11/Dockerfile.c9s | 2 +- 10.11/Dockerfile.fedora | 2 +- 10.11/Dockerfile.rhel10 | 2 +- 10.11/Dockerfile.rhel8 | 2 +- 10.11/Dockerfile.rhel9 | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/10.11/Dockerfile.c10s b/10.11/Dockerfile.c10s index 730783c..1f4dafe 100644 --- a/10.11/Dockerfile.c10s +++ b/10.11/Dockerfile.c10s @@ -44,7 +44,7 @@ RUN INSTALL_PKGS="policycoreutils rsync tar xz gettext hostname bind-utils groff rpm -V $INSTALL_PKGS && \ /usr/libexec/mysqld -V | grep -qe "$MYSQL_VERSION\." && echo "Found VERSION $MYSQL_VERSION" && \ dnf -y clean all --enablerepo='*' && \ - mkdir -p /var/lib/mysql/data && chown -R mysql:0 /var/lib/mysql && \ + mkdir -p /var/lib/mysql/data && chown -R mysql:root /var/lib/mysql && \ test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" # Get prefix path and path to scripts rather than hard-code them in scripts diff --git a/10.11/Dockerfile.c8s b/10.11/Dockerfile.c8s index 12352f3..6495a73 100644 --- a/10.11/Dockerfile.c8s +++ b/10.11/Dockerfile.c8s @@ -42,7 +42,7 @@ RUN yum -y module enable mariadb:$MYSQL_VERSION && \ rpm -V $INSTALL_PKGS && \ /usr/libexec/mysqld -V | grep -qe "$MYSQL_VERSION\." && echo "Found VERSION $MYSQL_VERSION" && \ yum -y clean all --enablerepo='*' && \ - mkdir -p /var/lib/mysql/data && chown -R mysql.0 /var/lib/mysql && \ + mkdir -p /var/lib/mysql/data && chown -R mysql:root /var/lib/mysql && \ test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" # Get prefix path and path to scripts rather than hard-code them in scripts diff --git a/10.11/Dockerfile.c9s b/10.11/Dockerfile.c9s index a34ba3c..b0cf236 100644 --- a/10.11/Dockerfile.c9s +++ b/10.11/Dockerfile.c9s @@ -42,7 +42,7 @@ RUN yum -y module enable mariadb:$MYSQL_VERSION && \ rpm -V $INSTALL_PKGS && \ /usr/libexec/mysqld -V | grep -qe "$MYSQL_VERSION\." && echo "Found VERSION $MYSQL_VERSION" && \ yum -y clean all --enablerepo='*' && \ - mkdir -p /var/lib/mysql/data && chown -R mysql.0 /var/lib/mysql && \ + mkdir -p /var/lib/mysql/data && chown -R mysql:root /var/lib/mysql && \ test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" # Get prefix path and path to scripts rather than hard-code them in scripts diff --git a/10.11/Dockerfile.fedora b/10.11/Dockerfile.fedora index 9a7534c..86bcac3 100644 --- a/10.11/Dockerfile.fedora +++ b/10.11/Dockerfile.fedora @@ -44,7 +44,7 @@ RUN INSTALL_PKGS="policycoreutils rsync tar gettext hostname bind-utils groff-ba rpm -V $INSTALL_PKGS && \ /usr/libexec/mysqld -V | grep -qe "$MYSQL_VERSION\." && echo "Found VERSION $MYSQL_VERSION" && \ dnf -y clean all --enablerepo='*' && \ - mkdir -p /var/lib/mysql/data && chown -R mysql.0 /var/lib/mysql && \ + mkdir -p /var/lib/mysql/data && chown -R mysql:root /var/lib/mysql && \ test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" # Get prefix path and path to scripts rather than hard-code them in scripts diff --git a/10.11/Dockerfile.rhel10 b/10.11/Dockerfile.rhel10 index 27c3814..6a88c85 100644 --- a/10.11/Dockerfile.rhel10 +++ b/10.11/Dockerfile.rhel10 @@ -43,7 +43,7 @@ RUN INSTALL_PKGS="policycoreutils rsync tar xz gettext hostname bind-utils groff rpm -V $INSTALL_PKGS && \ /usr/libexec/mysqld -V | grep -qe "$MYSQL_VERSION\." && echo "Found VERSION $MYSQL_VERSION" && \ dnf -y clean all --enablerepo='*' && \ - mkdir -p /var/lib/mysql/data && chown -R mysql:0 /var/lib/mysql && \ + mkdir -p /var/lib/mysql/data && chown -R mysql:root /var/lib/mysql && \ test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" # Get prefix path and path to scripts rather than hard-code them in scripts diff --git a/10.11/Dockerfile.rhel8 b/10.11/Dockerfile.rhel8 index 2eafba3..c0b4e47 100644 --- a/10.11/Dockerfile.rhel8 +++ b/10.11/Dockerfile.rhel8 @@ -42,7 +42,7 @@ RUN yum -y module enable mariadb:$MYSQL_VERSION && \ rpm -V $INSTALL_PKGS && \ /usr/libexec/mysqld -V | grep -qe "$MYSQL_VERSION\." && echo "Found VERSION $MYSQL_VERSION" && \ yum -y clean all --enablerepo='*' && \ - mkdir -p /var/lib/mysql/data && chown -R mysql.0 /var/lib/mysql && \ + mkdir -p /var/lib/mysql/data && chown -R mysql:root /var/lib/mysql && \ test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" # Get prefix path and path to scripts rather than hard-code them in scripts diff --git a/10.11/Dockerfile.rhel9 b/10.11/Dockerfile.rhel9 index 3946405..429c3c2 100644 --- a/10.11/Dockerfile.rhel9 +++ b/10.11/Dockerfile.rhel9 @@ -42,7 +42,7 @@ RUN yum -y module enable mariadb:$MYSQL_VERSION && \ rpm -V $INSTALL_PKGS && \ /usr/libexec/mysqld -V | grep -qe "$MYSQL_VERSION\." && echo "Found VERSION $MYSQL_VERSION" && \ yum -y clean all --enablerepo='*' && \ - mkdir -p /var/lib/mysql/data && chown -R mysql.0 /var/lib/mysql && \ + mkdir -p /var/lib/mysql/data && chown -R mysql:root /var/lib/mysql && \ test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" # Get prefix path and path to scripts rather than hard-code them in scripts