• Home
Name
Date
Size
#Lines
LOC

..--

standard/12-May-2024-283210

CHANGELOG.mdD12-May-2024652 3112

CHANGELOG_en.mdD12-May-2024710 3112

DockerfileD12-May-20244.5 KiB9085

LICENSED12-May-202411.1 KiB202169

README.mdD12-May-20242.7 KiB5646

README_en.mdD12-May-20243.4 KiB5646

build.shD12-May-2024646 171

sources.listD12-May-20241.7 KiB2824

README.md

1# OpenHarmony Docker镜像
2
3### Docker镜像简介
4
5本文为小型和轻量系统类设备Docker使用指导,[点此查看](https://gitee.com/openharmony/docs/blob/master/docker/standard/Readme.md)标准系统类设备使用指导。
6
7OpenHarmony的Docker镜像托管在**HuaweiCloud SWR**上,开发者可以通过该镜像在很大程度上简化编译前的环境配置。 目前容器化构建选项支持情况如下:
8
9| Docker镜像仓库                                               | 标签    | 说明                                                         |
10| :----------------------------------------------------------- | :------ | :----------------------------------------------------------- |
11| `swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker` | `0.0.5` | 已经预安装HarmonyOSOpenHarmony版本的编译环境,支持轻量系统类设备(参考内存≥128KB)和小型系统类设备(参考内存≥1MB)的版本构建。 |
12
13### 使用方式及步骤
14
15 开发者在配置好开发环境后,可以通过以下步骤来使用我们提供的Docker环境,支持Ubuntu/Windows平台,下文将以Ubuntu系统为例进行使用介绍。
16
17#### 方式一:从**HuaweiCloud SWR**上直接获取Docker镜像进行构建:
18
191. 获取Docker镜像
20     ```
21     docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.5
22     ```
232. 进入OpenHarmony代码根目录执行如下命令,从而进入Docker构建环境
24     ```
25     docker run -it -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.5
26     ```
273. 通过如下命令启动不同平台的编译
28     ```
29     hb set #设置工作目录。
30     . #输入源码所在目录,点(.)表示当前目录。
31     在显示的页面中通过键盘上下键选择需要编译的平台,通过回车确定选择。
32     hb build -f #执行编译。
33     ```
34
35 #### 方式二:通过Dockerfile 构建本地Docker镜像进行构建
361. 获取Dockerfile脚本文件,用来构建本地Docker镜像
37     ```
38     git clone https://gitee.com/openharmony/docs.git
39     ```
402. 进入Dockerfile代码目录路径执行Docker镜像构建命令
41     ```
42     cd docs/docker
43     ./build.sh
44     ```
454. 进入OpenHarmony代码根目录执行如下命令,从而进入Docker构建环境
46     ```
47     docker run -it -v $(pwd):/home/openharmony openharmony-docker:0.0.5
48     ```
495. 通过如下命令启动不同平台的编译
50     ```
51     hb set #设置工作目录。
52     . #输入源码所在目录,点(.)表示当前目录。
53     在显示的页面中通过键盘上下键选择需要编译的平台,通过回车确定选择。
54     hb build -f #执行编译。
55     ```
56

README_en.md

1# OpenHarmony Docker Image
2
3### Docker Image
4
5This document provides guidance on building the Docker image for mini- and small-system devices. For details about how to build the Docker image for standard-system devices, see [OpenHarmony Docker Image](https://gitee.com/openharmony/docs/blob/master/docker/standard/Readme-en.md)
6
7The Docker image of OpenHarmony is hosted on [HUAWEI Cloud SWR](https://auth.huaweicloud.com/authui/login.html?service=https%3A%2F%2Fconsole.huaweicloud.com%2Fswr%2F%3Fregion%3Dcn-south-1%26cloud_route_state%3D%2Fapp%2Fwarehouse%2FwarehouseMangeDetail%2Fgoldensir%2Fopenharmony-docker%2Fopenharmony-docker%3Ftype%3DownImage&locale=en-us#/login). Using the Docker image will help simplify environment configurations needed for the building. The following table lists container-based options needed for building in the standalone Docker environment.
8
9| Docker Image Repository                                      | Tag     | Description                                                  |
10| :----------------------------------------------------------- | :------ | :----------------------------------------------------------- |
11| `swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker` | `0.0.5` | The HarmonyOSOpenHarmony build environment has been pre-installed. This repository applies to Mini-System Devices (reference memory ≥ 128 KB) and Small-System Devices (reference memory ≥ 1 MB). |
12
13### Usage
14
15 After configuring the development environments, perform the steps below to access the Docker environment. The following steps use Ubuntu as an example (Windows is also supported).
16
17#### **Method 1: Obtaining the Docker image from HuaweiCloud SWR**:
18
191. Obtain the Docker image.
20     ```
21     docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.5
22     ```
232. Go to the root directory of OpenHarmony code and run the following command to access the Docker build environment:
24     ```
25     docker run -it -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.5
26     ```
273. Run the following script to start building for different platforms.
28     ```
29     hb set # Set the working directory.
30     . # Enter the directory where the source code is stored. If the code is stored in the current directory, enter a period (.).
31     Press the Up or Down key to select the platform to build on, then press Enter.
32     hb build -f # Start building.
33     ```
34
35 #### **Method 2: Using the Dockerfile to Build a Local Docker Image**
361. Obtain the Dockerfile script for a local Docker image.
37     ```
38     git clone https://gitee.com/openharmony/docs.git
39     ```
402. Go to the directory of the Dockerfile code and run the following command to build the Docker image:
41     ```
42     cd docs/docker
43     ./build.sh
44     ```
454. Go to the root directory of OpenHarmony code and run the following command to access the Docker build environment:
46     ```
47     docker run -it -v $(pwd):/home/openharmony openharmony-docker:0.0.5
48     ```
495. Run the following script to start building for different platforms.
50     ```
51     hb set # Set the working directory.
52     . # Enter the directory where the source code is stored. If the code is stored in the current directory, enter a period (.).
53     Press the Up or Down key to select the platform to build on, then press Enter.
54     hb build -f # Start building.
55     ```
56