From 5c7c15e0ff6866375c9adb3a1733c5d658c5bf1b Mon Sep 17 00:00:00 2001 From: kazan417 Date: Thu, 14 Nov 2024 01:43:05 +0700 Subject: [PATCH] Improve security of container Use USER directive according to docker best practice. Run as non root. Required for OpenShift container certification. --- Dockerfile.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.template b/Dockerfile.template index 66b338cb..5d65b771 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -133,7 +133,7 @@ RUN set -ex; \ sed -i -e '/includedir/ {N;s/\(.*\)\n\(.*\)/\n\2\n\1/}' /etc/mysql/mariadb.cnf; \ fi - +USER mysql VOLUME /var/lib/mysql COPY healthcheck.sh /usr/local/bin/healthcheck.sh