Dockerfile 4.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# 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:20.04
MAINTAINER dongjinguang@huawei.com
WORKDIR /home/openharmony

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

ENV LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8