# Copyright (c) 2020 Huawei Device Co., Ltd. # Licensed 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. FROM ubuntu:18.04 WORKDIR /home/openharmony ARG DEBIAN_FRONTEND=noninteractive ARG PREBUILTS_DIR=/home/prebuilts ARG HOME_TOOLS=/home/tools RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak COPY sources.list /etc/apt RUN apt-get update \ && apt-get install -y \ apt-utils \ vim \ tar \ binutils \ software-properties-common \ openssh-server \ iputils-ping \ curl \ net-tools \ bsdmainutils \ kmod \ bc \ rsync \ gawk \ ssh \ ccache \ zip \ python-dev \ make \ m4 \ gcc-multilib \ ca-certificates-java \ unzip \ python3-yaml \ perl \ openssl \ libssl1.1 \ gnupg \ xsltproc \ x11proto-core-dev \ tcl \ python3-crypto \ python-yaml \ python-crypto \ libxml2-utils \ libxml2-dev \ libx11-dev \ libssl-dev \ libgl1-mesa-dev \ lib32z1-dev \ lib32ncurses5-dev \ g++-multilib \ flex \ bison \ doxygen \ git \ git-lfs \ subversion \ tofrodos \ pigz \ expect \ python3-xlrd \ python-xlrd \ wget \ git-core \ gperf \ build-essential \ zlib1g-dev \ libc6-dev-i386 \ lib32z-dev \ openjdk-8-jdk \ ruby \ gnutls-bin \ python3.8 \ python3-pip \ cpio \ genext2fs \ doxygen \ liblz4-tool \ && rm -rf /bin/sh /usr/bin/python /usr/bin/python3 \ && ln -s /bin/bash /bin/sh \ && ln -s /usr/bin/python3.8 /usr/bin/python3 \ && ln -s /usr/bin/python3.8 /usr/bin/python \ && python3 -m pip install --user ohos-build \ && mkdir -p $PREBUILTS_DIR/prebuilts $HOME_TOOLS RUN wget -P $HOME_TOOLS https://mirrors.huaweicloud.com/nodejs/v12.18.4/node-v12.18.4-linux-x64.tar.gz \ && wget -P $HOME_TOOLS https://mirrors.huaweicloud.com/nodejs/v12.18.4/node-v12.18.4-darwin-x64.tar.gz \ && tar xvf $HOME_TOOLS/node-v12.18.4-linux-x64.tar.gz -C $PREBUILTS_DIR/prebuilts \ && tar xvf $HOME_TOOLS/node-v12.18.4-darwin-x64.tar.gz -C $PREBUILTS_DIR/prebuilts \ && sed -i '$aexport PATH='"$PREBUILTS_DIR"'/prebuilts/node-v12.18.4-linux-x64/bin:$PATH' /root/.bashrc \ && sed -i '$aexport PATH='"$PREBUILTS_DIR"'/prebuilts/hc-gen:$PATH' /root/.bashrc \ && export PATH=$PATH:$PREBUILTS_DIR/prebuilts/node-v12.18.4-linux-x64/bin \ && export PATH=$PATH:$PREBUILTS_DIR/prebuilts/hc-gen \ && rm -rf $HOME_TOOLS \ && npm install -g @ohos/hpm-cli --registry https://registry.npm.taobao.org