From 9a57738f6316222812f46028678842d99b5583b7 Mon Sep 17 00:00:00 2001 From: jungle8023 Date: Tue, 2 Mar 2021 17:21:07 +0800 Subject: [PATCH 1/2] update dockerfile for tools update --- docker/Dockerfile | 11 ++++++----- docker/build.sh | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 612f8ef883d..52199ebb30f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -33,6 +33,7 @@ RUN apt-get update -y \ && DEBIAN_FRONTEND="noninteractive" TZ="America/New_York" apt-get -y install tzdata \ && apt-get install default-jre -y \ && apt-get install default-jdk -y \ + && apt-get install build-essential \ && 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 \ @@ -46,30 +47,30 @@ RUN apt-get update -y \ && 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 \ - && wget -P /home/tools https://repo.huaweicloud.com/harmonyos/compiler/gn/1523/linux/gn.1523.tar \ - && wget -P /home/tools https://mirrors.huaweicloud.com/nodejs/latest-v12.x/node-v12.20.0-linux-x64.tar.gz \ + && 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 \ && 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 \ && tar xvf /home/tools/llvm-linux-9.0.0-34042.tar -C /home/tools \ && 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 \ - && tar xvf /home/tools/gn.1523.tar -C /home/tools \ + && tar xvf /home/tools/gn-linux-x86-1717.tar.gz -C /home/tools \ && tar xvf /home/tools/node-v12.20.0-linux-x64.tar.gz -C /home/tools \ && 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 \ - && sed -i '$aexport PATH=/home/tools/gn:$PATH' /root/.bashrc \ && 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 \ + && sed -i '$aexport PATH=/root/.local/bin:$PATH' /root/.bashrc \ && 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 \ - && export PATH=/home/tools/gn:$PATH \ && export PATH=/home/tools/node-v12.20.0-linux-x64/bin:$PATH \ && export PATH=/home/tools:$PATH \ + && export PATH=/root/.local/bin:$PATH \ && rm -rf /home/tools/*.tar \ && rm -rf /home/tools/*.gz \ && npm install -g @ohos/hpm-cli --registry https://mirrors.huaweicloud.com/repository/npm/ diff --git a/docker/build.sh b/docker/build.sh index f32935d751a..e292eab702d 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -13,4 +13,4 @@ #!/bin/sh -docker build -t openharmony-docker:0.0.2 . +docker build -t openharmony-docker:0.0.3 . -- Gitee From ed477954ff9e1810049e342f9f12ef70c4c9fab5 Mon Sep 17 00:00:00 2001 From: chengkun Date: Tue, 2 Mar 2021 18:17:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9readme=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/README.md | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/docker/README.md b/docker/README.md index b10d17c7a32..17cf94c1447 100644 --- a/docker/README.md +++ b/docker/README.md @@ -4,9 +4,9 @@ OpenHarmony的Docker镜像托管在**HuaweiCloud SWR**上,开发者可以通过该镜像在很大程度上简化编译前的环境配置。 目前容器化构建选项支持情况如下: - | 硬件平台 | Docker镜像仓库 | 标签 | 说明 | - | :----- | :------------------------ | :----------------------- | :--------------------------------------- | - | 3861/3516/3518 | `swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker` | `0.0.2` | 已经预安装Openharmony `0.0.2` 版本的编译环境。 | +| 硬件平台 | Docker镜像仓库 | 标签 | 说明 | +| :----- | :------------------------ | :----------------------- | :--------------------------------------- | +| ipcamera_hispark_taurus@hisilicon
ipcamera_hispark_aries@hisilicon
wifiiot_hispark_pegasus@hisilicon | `swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker` | `0.0.3` | 已经预安装Openharmony `0.0.3` 版本的编译环境。 | ### 使用方式及步骤 @@ -16,17 +16,19 @@ OpenHarmony的Docker镜像托管在**HuaweiCloud SWR**上,开发者可以通 1. 获取Docker镜像 ``` - docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.2 + docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.3 ``` 2. 进入OpenHarmony代码根目录执行如下命令,从而进入Docker构建环境 ``` - docker run -it -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.2 + docker run -it -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.3 ``` -3. 通过如下编译脚本启动wifiiot、ipcamera_hi3516dv300、ipcamera_hi3518ev300不同平台的编译 +3. 通过如下命令启动不同平台的编译 ``` - python build.py wifiiot/ipcamera_hi3516dv300/ipcamera_hi3518ev300 + python3 -m pip install --user build/lite #安装工具hb + hb set #设置编译路径,输入点(.)为当前路径 + hb build -f 执行编译 ``` - + #### 方式二:通过Dockerfile 构建本地Docker镜像进行构建 1. 获取Dockerfile脚本文件,用来构建本地Docker镜像 ``` @@ -39,9 +41,11 @@ OpenHarmony的Docker镜像托管在**HuaweiCloud SWR**上,开发者可以通 ``` 4. 进入OpenHarmony代码根目录执行如下命令,从而进入Docker构建环境 ``` - docker run -it -v $(pwd):/home/openharmony openharmony-docker:0.0.2 + docker run -it -v $(pwd):/home/openharmony openharmony-docker:0.0.3 ``` -5. 通过如下编译脚本启动wifiiot、ipcamera_hi3516dv300、ipcamera_hi3518ev300不同平台的编译 +5. 通过如下命令启动不同平台的编译 ``` - python build.py wifiiot/ipcamera_hi3516dv300/ipcamera_hi3518ev300 + python3 -m pip install --user build/lite #安装工具hb + hb set #设置编译路径,输入点(.)为当前路径 + hb build -f 执行编译 ``` -- Gitee