This is an automated email from the ASF dual-hosted git repository.

shreemaanabhishek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-docker.git


The following commit(s) were added to refs/heads/master by this push:
     new dd751e3  fix: Fixed Dockerfiles to be able to run in Openshift without 
anyuid (#617)
dd751e3 is described below

commit dd751e3ef3d6c36e5506d8480d8b0e28866e2991
Author: sebgott <[email protected]>
AuthorDate: Mon Apr 13 07:26:14 2026 +0200

    fix: Fixed Dockerfiles to be able to run in Openshift without anyuid (#617)
---
 debian/Dockerfile | 3 ++-
 redhat/Dockerfile | 7 +++++++
 ubuntu/Dockerfile | 3 ++-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/debian/Dockerfile b/debian/Dockerfile
index c88fa51..a90367e 100644
--- a/debian/Dockerfile
+++ b/debian/Dockerfile
@@ -53,7 +53,8 @@ ENV 
PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/
 
 RUN groupadd --system --gid 636 apisix \
     && useradd --system --gid apisix --no-create-home --shell 
/usr/sbin/nologin --uid 636 apisix \
-    && chown -R apisix:apisix /usr/local/apisix
+    && chown -R apisix:0 /usr/local/apisix \
+    && chmod -R g=u /usr/local/apisix
 
 USER apisix
 
diff --git a/redhat/Dockerfile b/redhat/Dockerfile
index a81293e..8469bd8 100644
--- a/redhat/Dockerfile
+++ b/redhat/Dockerfile
@@ -35,11 +35,18 @@ WORKDIR /usr/local/apisix
 
 ENV 
PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin
 
+RUN groupadd --system --gid 636 apisix \
+    && useradd --system --gid apisix --no-create-home --shell 
/usr/sbin/nologin --uid 636 apisix \
+    && chown -R apisix:0 /usr/local/apisix \
+    && chmod -R g=u /usr/local/apisix
+
 # forward request and error logs to docker log collector
 RUN ln -sf /dev/stdout /usr/local/apisix/logs/access.log \
     && ln -sf /dev/stderr /usr/local/apisix/logs/error.log \
     && rm /usr/local/openresty/bin/etcdctl
 
+USER apisix
+
 EXPOSE 9080 9443
 
 COPY ./docker-entrypoint.sh /docker-entrypoint.sh
diff --git a/ubuntu/Dockerfile b/ubuntu/Dockerfile
index 3fb7c94..6b85a63 100644
--- a/ubuntu/Dockerfile
+++ b/ubuntu/Dockerfile
@@ -53,7 +53,8 @@ ENV 
PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/
 
 RUN groupadd --system --gid 636 apisix \
     && useradd --system --gid apisix --no-create-home --shell 
/usr/sbin/nologin --uid 636 apisix \
-    && chown -R apisix:apisix /usr/local/apisix
+    && chown -R apisix:0 /usr/local/apisix \
+    && chmod -R g=u /usr/local/apisix
 
 USER apisix
 

Reply via email to