You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2024/02/21 08:14:43 UTC
(pulsar) branch branch-3.2 updated: [fix][broker] Support running docker container with gid != 0 (#22081)
This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-3.2 by this push:
new b7a1ee62916 [fix][broker] Support running docker container with gid != 0 (#22081)
b7a1ee62916 is described below
commit b7a1ee6291699ac1c3fd7e4400edc60d79bc4708
Author: Lari Hotari <lh...@users.noreply.github.com>
AuthorDate: Wed Feb 21 09:34:29 2024 +0200
[fix][broker] Support running docker container with gid != 0 (#22081)
(cherry picked from commit 4097ddd5e8c4fae4d95c939222341e5ad5dd6d20)
---
docker/pulsar/Dockerfile | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/docker/pulsar/Dockerfile b/docker/pulsar/Dockerfile
index 4e5885ce55d..6a0dc0100e7 100644
--- a/docker/pulsar/Dockerfile
+++ b/docker/pulsar/Dockerfile
@@ -36,10 +36,14 @@ COPY scripts/install-pulsar-client.sh /pulsar/bin
# The final image needs to give the root group sufficient permission for Pulsar components
# to write to specific directories within /pulsar
+# The ownership is changed to uid 10000 to allow using a different root group. This is necessary when running the
+# container when gid=0 is prohibited. In that case, the container must be run with uid 10000 with
+# any group id != 0 (for example 10001).
# The file permissions are preserved when copying files from this builder image to the target image.
RUN for SUBDIRECTORY in conf data download logs; do \
[ -d /pulsar/$SUBDIRECTORY ] || mkdir /pulsar/$SUBDIRECTORY; \
- chmod -R g+w /pulsar/$SUBDIRECTORY; \
+ chmod -R ug+w /pulsar/$SUBDIRECTORY; \
+ chown -R 10000:0 /pulsar/$SUBDIRECTORY; \
done
### Create 2nd stage from Ubuntu image