You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kyuubi.apache.org by "zwangsheng (via GitHub)" <gi...@apache.org> on 2023/01/31 01:55:33 UTC

[GitHub] [kyuubi-docker] zwangsheng commented on a diff in pull request #1: Initial docker file

zwangsheng commented on code in PR #1:
URL: https://github.com/apache/kyuubi-docker/pull/1#discussion_r1091343403


##########
.github/workflows/docker-image.yml:
##########
@@ -0,0 +1,58 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+name: Publish Docker image
+
+on:
+  push:
+    tags:
+      - '*'
+
+jobs:
+  push_to_registry:
+    name: Push Docker image to Docker Hub
+    if: ${{ startsWith(github.repository, 'apache/') }}
+    runs-on: ubuntu-22.04
+    strategy:
+       matrix:
+         include:
+           - suffix-name: ''
+             opts: '--flink-provided --spark-provided --hive-provided'
+           - suffix-name: '-spark'
+             opts: '--flink-provided --hive-provided'
+           - suffix-name: '-flink'
+             opts: '--spark-provided --hive-provided'
+           - suffix-name: '-all'
+             opts: ''
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v3
+      - name: Login to Docker Hub
+        uses: docker/login-action@v2
+        with:
+          username: ${{ secrets.DOCKERHUB_USER }}
+          password: ${{ secrets.DOCKERHUB_TOKEN }}
+      - name: Build Kyuubi Docker Image
+        run: |
+          wget -O kyuubi.tgz https://archive.apache.org/dist/kyuubi/kyuubi-$(cat release/release_version)/apache-kyuubi-$(cat release/release_version)-source.tgz
+          tar -xvf kyuubi.tgz --strip-components=1
+          ./build/dist ${{ matrix.opts }} -Dmaven.javadoc.skip=true -Dmaven.scaladoc.skip=true -Drat.skip=true -Dscalastyle.skip=true -Dspotless.check.skip -DskipTests
+          docker build --tag apache/kyuubi:$(cat release/release_version)${{ matrix.suffix-name }} --file $(cat release/release_version)/*/Dockerfile .

Review Comment:
   1. We need to think about reducing the scope of the docker context coverage, because Docker Daemon loads all the current directories (due to `.`) into the context, which can cause the build image to slow down.



##########
1.6.1-incubating/scala2.12-java8-ubuntu/Dockerfile:
##########
@@ -0,0 +1,31 @@
+FROM eclipse-temurin:8-jre
+
+ARG kyuubi_uid=10009
+
+USER root
+
+ENV KYUUBI_HOME /opt/kyuubi
+ENV KYUUBI_LOG_DIR ${KYUUBI_HOME}/logs
+ENV KYUUBI_PID_DIR ${KYUUBI_HOME}/pid
+ENV KYUUBI_WORK_DIR_ROOT ${KYUUBI_HOME}/work
+
+RUN set -ex; \
+   sed -i 's/http:\/\/deb.\(.*\)/https:\/\/deb.\1/g' /etc/apt/sources.list; && \
+   apt-get update && \
+   apt install -y wget bash tini libc6 libpam-modules krb5-user libnss3 procps; && \
+   mkdir -p ${KYUUBI_HOME} ${KYUUBI_LOG_DIR} ${KYUUBI_PID_DIR} ${KYUUBI_WORK_DIR_ROOT} && \
+   rm -rf /var/cache/apt/* && rm -rf /var/lib/apt/lists/*
+
+COPY dist ${KYUUBI_HOME}
+
+# setup kyuubi
+RUN set -ex && \
+   useradd -u ${kyuubi_uid} -g root kyuubi && \

Review Comment:
   We should give `kyuubi` user home dir, such as `/home/kyuubi`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org