Skip to content

Commit

Permalink
[improve][build] Add a default username in the image (apache#21695)
Browse files Browse the repository at this point in the history
### Motivation

Add a default username in the pulsar image. When using HDFS offloader, it requires a username to transfer the file.
  • Loading branch information
zymap committed Dec 18, 2023
1 parent 851b4b5 commit d5f0097
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 2 additions & 0 deletions docker/pulsar/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
ARG UBUNTU_MIRROR=http://archive.ubuntu.com/ubuntu/
ARG UBUNTU_SECURITY_MIRROR=http://security.ubuntu.com/ubuntu/
ARG DEFAULT_USERNAME=pulsar
ARG JDK_MAJOR_VERSION=17

# Install some utilities
Expand Down Expand Up @@ -106,4 +107,5 @@ 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.
RUN useradd ${DEFAULT_USERNAME} -u 10000 -g 0
USER 10000
4 changes: 0 additions & 4 deletions tests/docker-images/latest-version-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ 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 d5f0097

Please sign in to comment.