Skip to content

Commit

Permalink
[fix][broker] Support running docker container with gid != 0 (#22081)
Browse files Browse the repository at this point in the history
(cherry picked from commit 4097ddd)
  • Loading branch information
lhotari committed Feb 21, 2024
1 parent d02ba2c commit 47972af
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docker/pulsar/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

# Trino writes logs to this directory (at least during tests), so we need to give the process permission
Expand Down

0 comments on commit 47972af

Please sign in to comment.