diff --git a/Dockerfile b/Dockerfile index a5168d8..9cb65b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ COPY --chmod=500 mariadb_repo_setup /tmp/mariadb_repo_setup RUN /tmp/mariadb_repo_setup --mariadb-maxscale-version=${MXS_VERSION} --skip-check-installed # Install MaxScale -RUN microdnf -y install maxscale && microdnf clean all +RUN microdnf -y install maxscale shadow-utils && microdnf clean all COPY maxscale.cnf /etc/ # Copy licenses. Required for OpenShift container certification. @@ -15,5 +15,13 @@ COPY LICENSE /licenses/ # Expose REST API port. EXPOSE 8989 -ENTRYPOINT ["maxscale","--nodaemon", "--user=root", "--log=stdout"] +# Create maxscale user +RUN useradd -r maxscale && \ + chown maxscale:maxscale /var/{lib,run,log,cache}/maxscale + +USER maxscale + +VOLUME /var/lib/maxscale + +ENTRYPOINT ["maxscale","--nodaemon", "--user=maxscale", "--log=stdout"]