You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ho...@apache.org on 2022/10/31 08:50:06 UTC

[incubator-kyuubi] branch master updated: [KYUUBI #3719] [K8S] Create kyuubi user dir while building kyuubi docker image

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

hongdd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 292457edf [KYUUBI #3719] [K8S] Create kyuubi user dir  while building kyuubi docker image
292457edf is described below

commit 292457edf87fcdf3d18019c37078e59e9909bd2d
Author: zwangsheng <22...@qq.com>
AuthorDate: Mon Oct 31 16:49:56 2022 +0800

    [KYUUBI #3719] [K8S] Create kyuubi user dir  while building kyuubi docker image
    
    ### _Why are the changes needed?_
    
    Create kyuubi user directory  while building kyuubi docker image to avoid the issue that kyuubi user do not have a default user directory or do not have permission to create a default user.
    
    Also improved, change `KYUUBI_HOME` owner to kyuubi user.
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
    
    - [x] Add screenshots for manual tests if appropriate
    
    - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
    
    - [X] build docker image and run in kubernetes
    
    Closes #3719 from zwangsheng/imporve/kyuubi-dockerfile-kyuubi-user-file.
    
    Closes #3719
    
    45c1cb8a [zwangsheng] fix
    059dbd53 [zwangsheng] init
    
    Authored-by: zwangsheng <22...@qq.com>
    Signed-off-by: hongdongdong <ho...@apache.org>
---
 docker/Dockerfile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/docker/Dockerfile b/docker/Dockerfile
index 74681c2cd..5d8ca2827 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -51,10 +51,8 @@ RUN set -ex && \
     sed -i 's/http:\/\/deb.\(.*\)/https:\/\/deb.\1/g' /etc/apt/sources.list && \
     apt-get update && \
     apt install -y bash tini libc6 libpam-modules krb5-user libnss3 procps && \
-    useradd -u ${kyuubi_uid} -g root kyuubi && \
+    useradd -u ${kyuubi_uid} -g root kyuubi -d /home/kyuubi -m && \
     mkdir -p ${KYUUBI_HOME} ${KYUUBI_LOG_DIR} ${KYUUBI_PID_DIR} ${KYUUBI_WORK_DIR_ROOT} && \
-    chmod ug+rw -R ${KYUUBI_HOME} && \
-    chmod a+rwx -R ${KYUUBI_WORK_DIR_ROOT} && \
     rm -rf /var/cache/apt/*
 
 COPY bin ${KYUUBI_HOME}/bin
@@ -63,6 +61,9 @@ COPY beeline-jars ${KYUUBI_HOME}/beeline-jars
 COPY externals/engines/spark ${KYUUBI_HOME}/externals/engines/spark
 
 WORKDIR ${KYUUBI_HOME}
+RUN chown -R kyuubi:root ${KYUUBI_HOME} && \
+    chmod ug+rw -R ${KYUUBI_HOME} && \
+    chmod a+rwx -R ${KYUUBI_WORK_DIR_ROOT}
 
 CMD [ "./bin/kyuubi", "run" ]