#
# 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.
#

FROM alluxio/alluxio:313

USER root

RUN \
    yum update -y && yum upgrade -y && \
    yum install -y ca-certificates pkgconfig wget udev git gcc gcc-c++ make cmake gettext-devel libtool autoconf 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/v2.9)
RUN wget -qO /tmp/async-profiler-2.9-linux-x64.tar.gz "https://github.com/jvm-profiling-tools/async-profiler/releases/download/v2.9/async-profiler-2.9-linux-x64.tar.gz" && \
    tar -xvf /tmp/async-profiler-2.9-linux-x64.tar.gz -C /opt && \
    mv /opt/async-profiler-* /opt/async-profiler && \
    rm /tmp/async-profiler-2.9-linux-x64.tar.gz

USER ${ALLUXIO_UID}
