1 Star 1 Fork 5.3K

Dragon / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
quickstart-standard-docker-environment.md 4.28 KB
一键复制 编辑 原始数据 按行查看 历史
丛林 提交于 2021-09-18 17:48 . update format

Setting Up Ubuntu Development Environment in Docker Mode

The standard OpenHarmony system provides a Docker environment which encapsulates build tools.

NOTE:

Obtaining Standard-System Source Code

Prerequisites

  1. Register your account with Gitee.

  2. Register an SSH public key for access to Gitee.

  3. Install the git client and git-lfs, and configure basic user information.

    git config --global user.name "yourname"
    git config --global user.email "your-email-address"
    git config --global credential.helper store
  4. Run the following commands to install the repo tool:

    curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo  # If you do not have the access permission to this directory, download the tool to any other accessible directory and configure the directory to the environment variable.
    chmod a+x /usr/local/bin/repo
    pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests

Procedure

Method 1 (recommended): Use the repo tool to download the source code over SSH. (You must have registered an SSH public key for access to Gitee.)

repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
bash build/prebuilts_download.sh

Method 2: Use the repo tool to download the source code over HTTPS.

repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
bash build/prebuilts_download.sh

Obtaining the Docker Environment

Method 1: Obtaining the Docker image from HUAWEI CLOUD SWR

  1. Obtain the Docker image.

    docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker-standard:0.0.4
  2. Go to the root directory of OpenHarmony code and run the following command to access the Docker build environment:

    docker run -it -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker-standard:0.0.4

Method 2: Using the Dockerfile to build a local docker image

  1. Obtain the Dockerfile script for a local Docker image.

    git clone https://gitee.com/openharmony/docs.git
  2. Go to the directory of the Dockerfile code and run the following command to build the Docker image:

    cd docs/docker/standard
    ./build.sh
  3. Go to the root directory of OpenHarmony code and run the following command to access the Docker build environment:

    docker run -it -v $(pwd):/home/openharmony openharmony-docker-standard:0.0.4

Building Source Code

  1. Run the following script to start building for Standard-System Devices (reference memory ≥ 128 MB):

    ./build.sh --product-name {product_name}

    product_name indicates the product supported by the current distribution, for example, Hi3516DV300.

    Files generated during the build are stored in the out/ohos-arm-release/ directory, and the generated image is stored in the out/ohos-arm-release/packages/phone/images/ directory.

  2. Burn the image. For details, see Burning Images.

NOTE: You can exit Docker by simply running the exit command.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hbu-dragon/docs.git
git@gitee.com:hbu-dragon/docs.git
hbu-dragon
docs
docs
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891