• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
14
15FROM ubuntu:20.04
16MAINTAINER dongjinguang@huawei.com
17WORKDIR /home/openharmony
18
19RUN apt-get update -y \
20    && apt-get install curl wget -y \
21	&& apt-get install vim -y \
22	&& apt-get install ssh -y \
23	&& apt-get install git -y \
24	&& apt-get install python3.8 -y \
25	&& apt-get install python3-pip -y \
26	&& apt-get install dosfstools -y \
27	&& apt-get install mtools -y \
28	&& apt-get install scons -y \
29	&& apt-get install make -y \
30	&& apt-get install libffi-dev -y \
31	&& apt-get install zip -y \
32	&& apt-get install python3-distutils -y \
33	&& apt-get install binutils -y \
34	&& apt-get install mtd-utils -y \
35	&& apt-get install libc6-dev-x32 -y \
36	&& DEBIAN_FRONTEND="noninteractive" TZ="America/New_York" apt-get -y install tzdata \
37	&& apt-get install default-jre -y \
38	&& apt-get install default-jdk -y \
39	&& apt-get install bison -y \
40	&& apt-get install flex -y \
41	&& apt-get install bc -y \
42	&& apt-get install u-boot-tools -y \
43	&& apt-get install gcc-arm-linux-gnueabi -y \
44	&& apt-get install build-essential \
45	&& apt-get install locales \
46	&& locale-gen "en_US.UTF-8" \
47	&& rm -rf /bin/sh /usr/bin/python /usr/bin/python3 \
48	&& ln -s /bin/bash /bin/sh \
49	&& ln -s /usr/bin/python3.8 /usr/bin/python3 \
50	&& ln -s /usr/bin/python3.8 /usr/bin/python \
51	&& pip3 install --trusted-host mirrors.aliyun.com -i https://mirrors.aliyun.com/pypi/simple setuptools \
52	&& pip3 install --trusted-host mirrors.aliyun.com -i https://mirrors.aliyun.com/pypi/simple kconfiglib \
53	&& pip3 install --trusted-host mirrors.aliyun.com -i http://mirrors.aliyun.com/pypi/simple pycryptodome \
54	&& pip3 install --trusted-host mirrors.aliyun.com -i https://mirrors.aliyun.com/pypi/simple ecdsa \
55	&& python3 -m pip install --user ohos-build \
56	&& mkdir -p /home/tools \
57	&& wget -P /home/tools https://repo.huaweicloud.com/harmonyos/compiler/clang/10.0.1-62608/linux/llvm.tar.gz \
58	&& wget -P /home/tools https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar \
59	&& wget -P /home/tools https://repo.huaweicloud.com/harmonyos/compiler/gcc_riscv32/7.3.0/linux/gcc_riscv32-linux-7.3.0.tar.gz \
60	&& wget -P /home/tools https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar \
61	&& wget -P /home/tools https://repo.huaweicloud.com/harmonyos/compiler/gn/1717/linux/gn-linux-x86-1717.tar.gz \
62	&& wget -P /home/tools https://mirrors.huaweicloud.com/nodejs/v12.20.0/node-v12.20.0-linux-x64.tar.gz \
63	&& wget -P /home/tools https://repo.huaweicloud.com/harmonyos/develop_tools/hmos_app_packing_tool.jar \
64	&& wget -P /home/tools https://repo.huaweicloud.com/harmonyos/develop_tools/hapsigntoolv2.jar \
65    && tar xvf /home/tools/llvm.tar.gz -C /home/tools \
66	&& tar xvf /home/tools/hc-gen-0.65-linux.tar -C /home/tools \
67	&& tar xvf /home/tools/gcc_riscv32-linux-7.3.0.tar.gz -C /home/tools \
68	&& tar xvf /home/tools/ninja.1.9.0.tar -C /home/tools \
69	&& tar xvf /home/tools/gn-linux-x86-1717.tar.gz -C /home/tools \
70	&& tar xvf /home/tools/node-v12.20.0-linux-x64.tar.gz -C /home/tools \
71	&& sed -i '$aexport PATH=/home/tools/llvm/bin:$PATH' /root/.bashrc \
72	&& sed -i '$aexport PATH=/home/tools/hc-gen:$PATH' /root/.bashrc \
73	&& sed -i '$aexport PATH=/home/tools/gcc_riscv32/bin:$PATH' /root/.bashrc \
74	&& sed -i '$aexport PATH=/home/tools/ninja:$PATH' /root/.bashrc \
75	&& sed -i '$aexport PATH=/home/tools/node-v12.20.0-linux-x64/bin:$PATH' /root/.bashrc \
76	&& sed -i '$aexport PATH=/home/tools:$PATH' /root/.bashrc \
77	&& sed -i '$aexport PATH=/root/.local/bin:$PATH' /root/.bashrc \
78	&& export PATH=/home/tools/llvm/bin:$PATH \
79	&& export PATH=/home/tools/hc-gen:$PATH \
80	&& export PATH=/home/tools/gcc_riscv32/bin:$PATH \
81	&& export PATH=/home/tools/ninja:$PATH \
82	&& export PATH=/home/tools/node-v12.20.0-linux-x64/bin:$PATH \
83	&& export PATH=/home/tools:$PATH \
84	&& export PATH=/root/.local/bin:$PATH \
85	&& rm -rf /home/tools/*.tar \
86	&& rm -rf /home/tools/*.gz \
87	&& npm install -g @ohos/hpm-cli --registry https://mirrors.huaweicloud.com/repository/npm/
88
89ENV LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8
90