|
| 1 | +# |
| 2 | +# Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | +# contributor license agreements. See the NOTICE file distributed with |
| 4 | +# this work for additional information regarding copyright ownership. |
| 5 | +# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | +# (the "License"); you may not use this file except in compliance with |
| 7 | +# the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# |
| 17 | + |
| 18 | +FROM eclipse-temurin:8-jdk-focal |
| 19 | + |
| 20 | +ARG kyuubi_uid=10009 |
| 21 | + |
| 22 | +USER root |
| 23 | + |
| 24 | +ENV KYUUBI_USER_HOME /home/kyuubi |
| 25 | +ENV KYUUBI_HOME /opt/kyuubi |
| 26 | +ENV KYUUBI_LOG_DIR ${KYUUBI_HOME}/logs |
| 27 | +ENV KYUUBI_PID_DIR ${KYUUBI_HOME}/pid |
| 28 | +ENV KYUUBI_WORK_DIR_ROOT ${KYUUBI_HOME}/work |
| 29 | + |
| 30 | +RUN set -ex; \ |
| 31 | + sed -i 's/http:\/\/deb.\(.*\)/https:\/\/deb.\1/g' /etc/apt/sources.list && \ |
| 32 | + apt-get update && \ |
| 33 | + apt install -y wget bash tini libc6 libpam-modules krb5-user libnss3 procps && \ |
| 34 | + mkdir -p ${KYUUBI_HOME} ${KYUUBI_LOG_DIR} ${KYUUBI_PID_DIR} ${KYUUBI_WORK_DIR_ROOT} && \ |
| 35 | + rm -rf /var/cache/apt/* && rm -rf /var/lib/apt/lists/* |
| 36 | + |
| 37 | +COPY . ${KYUUBI_HOME} |
| 38 | + |
| 39 | +# setup kyuubi |
| 40 | +RUN set -ex && \ |
| 41 | + useradd -u ${kyuubi_uid} -g root kyuubi -d ${KYUUBI_USER_HOME} -m && \ |
| 42 | + chmod ug+rw -R ${KYUUBI_HOME} && \ |
| 43 | + chmod a+rwx -R ${KYUUBI_WORK_DIR_ROOT} |
| 44 | + |
| 45 | +WORKDIR ${KYUUBI_HOME} |
| 46 | + |
| 47 | +CMD [ "./bin/kyuubi", "run" ] |
| 48 | + |
| 49 | +USER ${kyuubi_uid} |
0 commit comments