Skip to content

Commit b011d31

Browse files
committed
Fix user/group creation
1 parent 8c3864f commit b011d31

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

10.11/Dockerfile.rhel10

+6-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ LABEL summary="${SUMMARY}" \
3535

3636
EXPOSE 3306
3737

38-
# This image must forever use UID 27 for mysql user so our volumes are
39-
# safe in the future. This should *never* change, the last test is there
40-
# to make sure of that.
38+
# This image must forever use UID 27 for mysql user so our volumes are safe in the future. This should *never* change.
39+
# Instead of relying on the package, we will do the setup ourselves before the package is installed
40+
RUN /usr/sbin/groupadd -g 27 -o -r mysql >/dev/null 2>&1 || : && \
41+
/usr/sbin/useradd -M -N -g mysql -o -r -d ${HOME} -s /sbin/nologin -c "MySQL Server" -u 27 mysql >/dev/null 2>&1 || : && \
42+
test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)"
43+
4144
RUN INSTALL_PKGS="policycoreutils rsync tar xz gettext hostname bind-utils groff-base ${NAME}${MARIADB_SHORT_VERSION}-server" && \
4245
dnf install -y --setopt=tsflags=nodocs ${INSTALL_PKGS} && \
4346
rpm -V ${INSTALL_PKGS} && \

0 commit comments

Comments
 (0)