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

# This is the Docker Image for Kylin 5 release process
#
# For what is release policy and release process, please refer to following link:
# 1. https://www.apache.org/legal/release-policy.html
# 2. https://infra.apache.org/release-publishing.html

FROM openjdk:8-slim

ENV M2_HOME /root/lib/apache-maven-3.8.8
ENV PATH $PATH:$M2_HOME/bin
ENV NVM_DIR="/root/.nvm"
USER root

WORKDIR /root

# Install tools
RUN set -eux; \
	apt-get update; \
	apt-get install -y --no-install-recommends lsof wget tar

RUN set -eux; \
	apt-get update; \
	apt-get install -y --no-install-recommends git unzip subversion

RUN set -eux; \
	apt-get update; \
	apt-get install -y --no-install-recommends curl vim ssh

RUN set -eux; \
	apt-get update; \
	apt-get install -y --no-install-recommends gcc g++ make bzip2

# Install maven
RUN wget https://archive.apache.org/dist/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz \
    && tar -zxvf apache-maven-3.8.8-bin.tar.gz \
    && rm -f apache-maven-3.8.8-bin.tar.gz \
    && mkdir /root/.m2 \
    && mkdir /root/lib/ \
    && mv apache-maven-3.8.8 /root/lib/

# Install jekyll for for kylin website
RUN apt-get install -y --fix-missing ruby-full
RUN gem install jekyll:2.5.3 jekyll-multiple-languages:1.0.11  rouge:1.10.1 kramdown:1.17.0

# Install Node JS for packaging
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \
    && apt-get update \
    && apt-get install -y --no-install-recommends nodejs

# Used to install Node JS 16.14(this new version is for kylin website)
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash