blob: 81fc34bfdd61221034a9db2de8fc53e43cb2e03f [file] [log] [blame]
# 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
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# See the License for the specific language governing permissions and
# limitations under the License.
FROM golang:1.14.2-buster
RUN GO111MODULE=off go get -u
FROM centos:7.6.1810
RUN yum -y install \
bzip2-devel \
gcc gcc-c++ gcc48-c++ \
git \
lz4-devel \
make \
snappy-devel \
which \
RUN git clone \
&& cd gflags \
&& git checkout v2.0 \
&& ./configure && make && make install
RUN curl -LSs -o zstd-1.1.3.tar.gz \
&& tar zxvf zstd-1.1.3.tar.gz \
&& cd zstd-1.1.3 \
&& make && make install
RUN curl -LSs -o rocksdb-6.8.1.tar.gz \
&& tar xzvf rocksdb-6.8.1.tar.gz \
&& cd rocksdb-6.8.1 \
&& make ldb
FROM centos@sha256:b5e66c4651870a1ad435cd75922fe2cb943c9e973a9673822d1414824a1d0475
RUN rpm -Uvh
RUN yum install -y \
bzip2 \
java-11-openjdk \
jq \
nmap-ncat \
python3 python3-pip \
snappy \
sudo \
wget \
COPY --from=0 /go/bin/csc /usr/bin/csc
COPY --from=1 /rocksdb-6.8.1/ldb /usr/local/bin/ldb
COPY --from=1 /usr/local/lib /usr/local/lib/
#For executing inline smoketest
RUN pip3 install robotframework
RUN pip3 install boto3
#dumb init for proper init handling
RUN wget -O /usr/local/bin/dumb-init
RUN chmod +x /usr/local/bin/dumb-init
#byteman test for development
ADD /opt/byteman.jar
RUN chmod o+r /opt/byteman.jar
#async profiler for development profiling
RUN mkdir -p /opt/profiler && \
cd /opt/profiler && \
curl -L | tar xvz
ENV JAVA_HOME=/usr/lib/jvm/jre/
ENV LD_LIBRARY_PATH /usr/local/lib
ENV PATH /opt/hadoop/libexec:$PATH:/opt/hadoop/bin
RUN groupadd --gid 1000 hadoop
RUN useradd --uid 1000 hadoop --gid 100 --home /opt/hadoop
RUN chmod 755 /opt/hadoop
RUN echo "hadoop ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
RUN chown hadoop /opt
#Be prepared for kerbebrizzed cluster
RUN mkdir -p /etc/security/keytabs && chmod -R a+wr /etc/security/keytabs
ADD krb5.conf /etc/
RUN chmod 644 /etc/krb5.conf
RUN yum install -y krb5-workstation
# CSI / k8s / fuse / goofys dependency
RUN wget -O /usr/bin/goofys
RUN chmod 755 /usr/bin/goofys
RUN yum install -y fuse
#Make it compatible with any UID/GID (write premission may be missing to /opt/hadoop
RUN mkdir -p /etc/hadoop && mkdir -p /var/log/hadoop && chmod 1777 /etc/hadoop && chmod 1777 /var/log/hadoop
ENV HADOOP_LOG_DIR=/var/log/hadoop
RUN mkdir /data && chmod 1777 /data
#default entrypoint (used only if the ozone dir is not bindmounted)
ADD /usr/local/bin/
RUN chmod 755 /usr/local/bin/
WORKDIR /opt/hadoop
USER hadoop
ENTRYPOINT ["/usr/local/bin/dumb-init", "--", ""]