/
githubmirror
/
alluxio
Обзор
Документация
Войти
/
githubmirror
/
alluxio
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v2.8.1
integration/docker/Dockerfile-dev
129 строк
5 KB
Lu Qiu
Update version to 2.8.1
05 авг 2022, 20:01
05 авг 2022, 20:01
35d2304
Код
Авторство
О чём код?
# # The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 # (the "License"). You may not use this work except in compliance with the License, which is # available at www.apache.org/licenses/LICENSE-2.0 # # This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, # either express or implied, as more fully set forth in the License. # # See the NOTICE file distributed with this work for information regarding copyright ownership. # # ARG defined before the first FROM can be used in FROM lines ARG JAVA_VERSION=8 # setup CSI # Make sure any changes to CSI installation are made in Dockerfile as well FROM golang:1.15.13-alpine AS csi-dev ENV GO111MODULE=on RUN mkdir -p /alluxio-csi COPY ./csi /alluxio-csi RUN cd /alluxio-csi && \ CGO_ENABLED=0 go build -o /usr/local/bin/alluxio-csi # We have to do an ADD to put the tarball into extractor, then do a COPY with chown into final # ADD then chown in two steps will double the image size # See - https://stackoverflow.com/questions/30085621/why-does-chown-increase-size-of-docker-image # - https://github.com/moby/moby/issues/5505 # - https://github.com/moby/moby/issues/6119 # ADD with chown doesn't chown the files inside tarball # See - https://github.com/moby/moby/issues/35525 FROM alpine:3.10.2 AS alluxio-extractor # Note that downloads for *-SNAPSHOT tarballs are not available. ARG ALLUXIO_TARBALL=http://downloads.alluxio.io/downloads/files/2.8.1/alluxio-2.8.1-bin.tar.gz # (Alert):It's not recommended to set this Argument to true, unless you know exactly what you are doing ARG ENABLE_DYNAMIC_USER=false ADD ${ALLUXIO_TARBALL} /opt/ # Remote tarball needs to be untarred. Local tarball is untarred automatically. # Use ln -s instead of mv to avoid issues with Centos (see https://github.com/moby/moby/issues/27358) RUN cd /opt && \ (if ls | grep -q ".tar.gz"; then tar -xzf *.tar.gz && rm *.tar.gz; fi) && \ ln -s alluxio-* alluxio RUN if [ ${ENABLE_DYNAMIC_USER} = "true" ] ; then \ chmod -R 777 /opt/* ; \ fi # Configure JAVA_HOME FROM centos:7 as build_java8 ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk FROM centos:7 as build_java11 ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk FROM build_java${JAVA_VERSION} AS final ADD dockerfile-common.sh / # Install libfuse2 and libfuse3. Libfuse2 setup is modified from cheyang/fuse2:ubuntu1604-customize to be applied on centOS WORKDIR / ENV MAX_IDLE_THREADS "64" RUN \ yum update -y && yum upgrade -y && \ yum install -y ca-certificates pkgconfig wget udev git && \ yum install -y gcc gcc-c++ make cmake gettext-devel libtool autoconf && \ yum clean all && \ ./dockerfile-common.sh install-libfuse2 && \ yum install -y fuse3 fuse3-devel fuse3-lib ENV LD_LIBRARY_PATH "/usr/local/lib:${LD_LIBRARY_PATH}" ARG ALLUXIO_USERNAME=alluxio ARG ALLUXIO_GROUP=alluxio ARG ALLUXIO_UID=1000 ARG ALLUXIO_GID=1000 ARG ENABLE_DYNAMIC_USER=true # Add Tini for alluxio helm charts (https://github.com/Alluxio/alluxio/pull/12233) # - https://github.com/krallin/tini ENV TINI_VERSION v0.18.0 ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/local/bin/tini RUN chmod +x /usr/local/bin/tini RUN \ yum install -y java-1.8.0-openjdk-devel java-1.8.0-openjdk && \ yum install -y java-11-openjdk-devel java-11-openjdk && \ yum install -y unzip vim && \ yum clean all # Install arthas(https://github.com/alibaba/arthas) for analyzing performance bottleneck RUN wget -qO /tmp/arthas.zip "https://github.com/alibaba/arthas/releases/download/arthas-all-3.4.6/arthas-bin.zip" && \ mkdir -p /opt/arthas && \ unzip /tmp/arthas.zip -d /opt/arthas && \ rm /tmp/arthas.zip # Install async-profiler(https://github.com/jvm-profiling-tools/async-profiler/releases/tag/v1.8.3) RUN wget -qO /tmp/async-profiler-1.8.3-linux-x64.tar.gz "https://github.com/jvm-profiling-tools/async-profiler/releases/download/v1.8.3/async-profiler-1.8.3-linux-x64.tar.gz" && \ tar -xvf /tmp/async-profiler-1.8.3-linux-x64.tar.gz -C /opt && \ mv /opt/async-profiler-* /opt/async-profiler && \ rm /tmp/async-profiler-1.8.3-linux-x64.tar.gz # Disable JVM DNS cache in both java8 and java11 (https://github.com/Alluxio/alluxio/pull/9452) RUN echo "networkaddress.cache.ttl=0" >> /usr/lib/jvm/java-1.8.0-openjdk/jre/lib/security/java.security RUN echo "networkaddress.cache.ttl=0" >> /usr/lib/jvm/java-11-openjdk/conf/security/java.security # Add the following for native libraries needed by rocksdb ENV LD_LIBRARY_PATH /lib64:${LD_LIBRARY_PATH} # If Alluxio user, group, gid, and uid aren't root|0, create the alluxio user and set file permissions accordingly RUN ./dockerfile-common.sh user-operation ${ALLUXIO_USERNAME} ${ALLUXIO_GROUP} ${ALLUXIO_UID} ${ALLUXIO_GID} centos # Docker 19.03+ required to expand variables in --chown argument # https://github.com/moby/buildkit/pull/926#issuecomment-503943557 COPY --from=alluxio-extractor --chown=${ALLUXIO_USERNAME}:${ALLUXIO_GROUP} /opt /opt/ COPY --chown=${ALLUXIO_USERNAME}:${ALLUXIO_GROUP} conf /opt/alluxio/conf/ COPY --chown=${ALLUXIO_USERNAME}:${ALLUXIO_GROUP} entrypoint.sh / COPY --from=csi-dev /usr/local/bin/alluxio-csi /usr/local/bin/ RUN ./dockerfile-common.sh enable-dynamic-user ${ENABLE_DYNAMIC_USER} USER ${ALLUXIO_UID} WORKDIR /opt/alluxio ENV PATH="/opt/alluxio/bin:${PATH}" ENTRYPOINT ["/entrypoint.sh"]