Skip to content

Commit

Permalink
[improve][sec] Revert "Add group pulsar and add user pulsar to it ins…
Browse files Browse the repository at this point in the history
…tead of root" (#21691)

Reverts #21084. Because the change breaks OpenShift support.
  • Loading branch information
yaalsn authored Dec 8, 2023
1 parent 61098ee commit 7e76c45
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
9 changes: 2 additions & 7 deletions docker/pulsar/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,7 @@ RUN mkdir /pulsar && chmod g+w /pulsar

ENV PULSAR_ROOT_LOGGER=INFO,CONSOLE

RUN groupadd -g 10000 pulsar && \
useradd -r -u 10000 -g pulsar pulsar

COPY --from=pulsar --chown=10000:10000 /pulsar /pulsar
RUN chown pulsar:pulsar /pulsar

COPY --from=pulsar /pulsar /pulsar
WORKDIR /pulsar

ARG PULSAR_CLIENT_PYTHON_VERSION
Expand All @@ -111,4 +106,4 @@ RUN chmod +x /pulsar/bin/install-pulsar-client.sh
RUN /pulsar/bin/install-pulsar-client.sh

# The UID must be non-zero. Otherwise, it is arbitrary. No logic should rely on its specific value.
USER 10000:10000
USER 10000
6 changes: 3 additions & 3 deletions tests/docker-images/java-test-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

FROM ubuntu:22.04

RUN groupadd -g 10000 pulsar && \
useradd -r -u 10000 -g pulsar pulsar
RUN groupadd -g 10001 pulsar
RUN adduser -u 10000 --gid 10001 --disabled-login --disabled-password --gecos '' pulsar

ARG PULSAR_TARBALL=target/pulsar-server-distribution-bin.tar.gz
ADD ${PULSAR_TARBALL} /
Expand Down Expand Up @@ -76,7 +76,7 @@ COPY target/java-test-functions.jar /pulsar/examples/

ENV PULSAR_ROOT_LOGGER=INFO,CONSOLE

RUN chown -R pulsar:pulsar /pulsar
RUN chown -R pulsar:0 /pulsar && chmod -R g=u /pulsar

# cleanup
RUN apt-get -y --purge autoremove \
Expand Down
4 changes: 4 additions & 0 deletions tests/docker-images/latest-version-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ FROM apachepulsar/pulsar:latest
# However, any processes exec'ing into the containers will run as root, by default.
USER root

# We need to define the user in order for supervisord to work correctly
# We don't need a user defined in the public docker image, though.
RUN adduser -u 10000 --gid 0 --disabled-login --disabled-password --gecos '' pulsar

RUN rm -rf /var/lib/apt/lists/* && apt update

RUN apt-get clean && apt-get update && apt-get install -y supervisor vim procps curl
Expand Down

0 comments on commit 7e76c45

Please sign in to comment.