1# Copyright (c) 2020 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14FROM ubuntu:18.04 15WORKDIR /home/openharmony 16 17ARG DEBIAN_FRONTEND=noninteractive 18ARG PREBUILTS_DIR=/home/prebuilts 19ARG HOME_TOOLS=/home/tools 20 21RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak 22 23COPY sources.list /etc/apt 24 25RUN apt-get update \ 26 && apt-get install -y \ 27 apt-utils \ 28 vim \ 29 software-properties-common \ 30 openssh-server \ 31 iputils-ping \ 32 curl \ 33 net-tools \ 34 bsdmainutils \ 35 kmod \ 36 bc \ 37 rsync \ 38 gawk \ 39 ssh \ 40 ccache \ 41 zip \ 42 python-dev \ 43 make \ 44 m4 \ 45 gcc-multilib \ 46 ca-certificates-java \ 47 unzip \ 48 python3-yaml \ 49 perl \ 50 openssl \ 51 libssl1.1 \ 52 gnupg \ 53 xsltproc \ 54 x11proto-core-dev \ 55 tcl \ 56 python3-crypto \ 57 python-yaml \ 58 python-crypto \ 59 libxml2-utils \ 60 libxml2-dev \ 61 libx11-dev \ 62 libssl-dev \ 63 libgl1-mesa-dev \ 64 lib32z1-dev \ 65 lib32ncurses5-dev \ 66 g++-multilib \ 67 flex \ 68 bison \ 69 doxygen \ 70 git \ 71 subversion \ 72 tofrodos \ 73 pigz \ 74 expect \ 75 python3-xlrd \ 76 python-xlrd \ 77 wget \ 78 git-core \ 79 gperf \ 80 build-essential \ 81 zlib1g-dev \ 82 libc6-dev-i386 \ 83 lib32z-dev \ 84 openjdk-8-jdk \ 85 ruby \ 86 && rm -rf /bin/sh \ 87 && ln -s /bin/bash /bin/sh \ 88 && mkdir -p $PREBUILTS_DIR/prebuilts $HOME_TOOLS 89 90RUN wget -P $HOME_TOOLS https://mirrors.huaweicloud.com/nodejs/v12.18.4/node-v12.18.4-linux-x64.tar.gz \ 91 && wget -P $HOME_TOOLS https://mirrors.huaweicloud.com/nodejs/v12.18.4/node-v12.18.4-darwin-x64.tar.gz \ 92 && tar xvf $HOME_TOOLS/node-v12.18.4-linux-x64.tar.gz -C $PREBUILTS_DIR/prebuilts \ 93 && tar xvf $HOME_TOOLS/node-v12.18.4-darwin-x64.tar.gz -C $PREBUILTS_DIR/prebuilts \ 94 && sed -i '$aexport PATH='"$PREBUILTS_DIR"'/prebuilts/node-v12.18.4-linux-x64/bin:$PATH' /root/.bashrc \ 95 && sed -i '$aexport PATH='"$PREBUILTS_DIR"'/prebuilts/hc-gen:$PATH' /root/.bashrc \ 96 && export PATH=$PATH:$PREBUILTS_DIR/prebuilts/node-v12.18.4-linux-x64/bin \ 97 && export PATH=$PATH:$PREBUILTS_DIR/prebuilts/hc-gen \ 98 && rm -rf $HOME_TOOLS \ 99 && npm install -g @ohos/hpm-cli --registry https://registry.npm.taobao.org 100