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

yong pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new c92c485dbd8 [improve][build] Add a default username in the image 
(#21695)
c92c485dbd8 is described below

commit c92c485dbd8de83e3958637791eaa301f6b2d1c9
Author: Yong Zhang <[email protected]>
AuthorDate: Mon Dec 18 09:26:54 2023 +0800

    [improve][build] Add a default username in the image (#21695)
    
    ### Motivation
    
    Add a default username in the pulsar image. When using HDFS offloader, it 
requires a username to transfer the file.
    
    (cherry picked from commit d5f00971dcf526e7e802bd1a5b77c766ae61560c)
---
 docker/pulsar/Dockerfile                            | 2 ++
 tests/docker-images/latest-version-image/Dockerfile | 4 ----
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/docker/pulsar/Dockerfile b/docker/pulsar/Dockerfile
index c8ff0ef4f18..a127af166eb 100644
--- a/docker/pulsar/Dockerfile
+++ b/docker/pulsar/Dockerfile
@@ -54,6 +54,7 @@ FROM ubuntu:22.04
 ARG DEBIAN_FRONTEND=noninteractive
 ARG UBUNTU_MIRROR=mirror://mirrors.ubuntu.com/mirrors.txt
 ARG UBUNTU_SECURITY_MIRROR=http://security.ubuntu.com/ubuntu/
+ARG DEFAULT_USERNAME=pulsar
 
 # Install some utilities
 RUN sed -i -e 
"s|http://archive\.ubuntu\.com/ubuntu/|${UBUNTU_MIRROR:-mirror://mirrors.ubuntu.com/mirrors.txt}|g"
 \
@@ -104,4 +105,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
diff --git a/tests/docker-images/latest-version-image/Dockerfile 
b/tests/docker-images/latest-version-image/Dockerfile
index 99672773dcb..602f917700b 100644
--- a/tests/docker-images/latest-version-image/Dockerfile
+++ b/tests/docker-images/latest-version-image/Dockerfile
@@ -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

Reply via email to