提交 0d5318ad 编写于 作者: C conglin

combine the docker of L01 and L2

Signed-off-by: Nconglin <conglin8023@126.com>
上级 134d4639
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
......@@ -12,80 +12,71 @@
# limitations under the License.
FROM ubuntu:20.04
MAINTAINER dongjinguang@huawei.com
FROM ubuntu:18.04
WORKDIR /home/openharmony
RUN apt-get update -y \
&& apt-get install curl wget -y \
&& apt-get install vim -y \
&& apt-get install ssh -y \
&& apt-get install git -y \
&& 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 \
&& 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 bison -y \
&& apt-get install flex -y \
&& apt-get install bc -y \
&& apt-get install doxygen -y \
&& apt-get install u-boot-tools -y \
&& apt-get install gcc-arm-linux-gnueabi -y \
&& apt-get install build-essential \
&& apt-get install locales \
&& apt-get install ruby -y \
RUN sed -i "s@http://.*archive.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list \
&& sed -i "s@http://.*security.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list \
&& apt-get update -y \
&& apt-get install -y apt-utils binutils bison flex bc build-essential make mtd-utils gcc-arm-linux-gnueabi u-boot-tools python3.8 python3-pip git zip unzip curl wget gcc g++ ruby=1:2.5.1 dosfstools mtools default-jre default-jdk scons python3.8-distutils perl openssl libssl-dev cpio git-lfs m4 ccache zlib1g-dev tar rsync liblz4-tool genext2fs binutils-dev device-tree-compiler e2fsprogs git-core gnupg gnutls-bin gperf lib32ncurses5-dev libffi-dev zlib* libelf-dev libx11-dev libgl1-mesa-dev lib32z1-dev xsltproc x11proto-core-dev libc6-dev-i386 libxml2-dev lib32z-dev libdwarf-dev \
&& apt-get install -y grsync xxd libglib2.0-dev libpixman-1-dev kmod jfsutils reiserfsprogs xfsprogs squashfs-tools pcmciautils quota ppp libtinfo-dev libtinfo5 libncurses5 libncurses5-dev libncursesw5 libstdc++6 python2.7 gcc-arm-none-eabi \
&& apt-get install -y vim ssh locales \
&& apt-get install -y doxygen \
&& locale-gen "en_US.UTF-8" \
&& rm -rf /bin/sh /usr/bin/python /usr/bin/python3 \
&& rm -rf /bin/sh /usr/bin/python /usr/bin/python3 /usr/bin/python3m \
&& ln -s /bin/bash /bin/sh \
&& ln -s /usr/bin/python3.8 /usr/bin/python3 \
&& ln -s /usr/bin/python3.8 /usr/bin/python3m \
&& ln -s /usr/bin/python3.8 /usr/bin/python \
&& 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 \
&& curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/bin/repo \
&& chmod +x /usr/bin/repo \
&& pip3 install --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple requests setuptools pymongo kconfiglib pycryptodome ecdsa ohos-build pyyaml prompt_toolkit==1.0.14 redis json2html yagmail python-jenkins \
&& pip3 install esdk-obs-python --trusted-host pypi.org \
&& pip3 install six --upgrade --ignore-installed six \
&& mkdir -p /home/tools \
&& mkdir -p /home/tools/gn \
&& wget -P /home/tools https://repo.huaweicloud.com/harmonyos/compiler/clang/10.0.1-62608/linux/llvm.tar.gz \
&& 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/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.tar.gz -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-linux-x86-1717.tar.gz -C /home/tools \
&& tar xvf /home/tools/node-v12.20.0-linux-x64.tar.gz -C /home/tools \
&& wget -P /home/tools https://mirrors.huaweicloud.com/nodejs/v14.15.4/node-v14.15.4-linux-x64.tar.xz \
&& wget -P /home/tools https://hm-verify.obs.cn-north-4.myhuaweicloud.com/qemu-5.2.0.tar.xz \
&& tar -xvf /home/tools/llvm.tar.gz -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-linux-x86-1717.tar.gz -C /home/tools/gn \
&& tar -xJf /home/tools/node-v14.15.4-linux-x64.tar.xz -C /home/tools \
&& cp /home/tools/node-v14.15.4-linux-x64/bin/node /usr/local/bin \
&& ln -s /home/tools/node-v14.15.4-linux-x64/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
&& ln -s /home/tools/node-v14.15.4-linux-x64/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx \
&& tar -xJf /home/tools/qemu-5.2.0.tar.xz -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/node-v12.20.0-linux-x64/bin:$PATH' /root/.bashrc \
&& sed -i '$aexport PATH=/home/tools:$PATH' /root/.bashrc \
&& sed -i '$aexport PATH=/home/tools/node-v14.15.4-linux-x64/bin:$PATH' /root/.bashrc \
&& sed -i '$aexport PATH=/home/tools/gn:$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/node-v12.20.0-linux-x64/bin:$PATH \
&& export PATH=/home/tools:$PATH \
&& export PATH=/home/tools/gn:$PATH \
&& export PATH=/root/.local/bin:$PATH \
&& cd /home/tools/qemu-5.2.0 \
&& mkdir build \
&& cd build \
&& ../configure --target-list=arm-softmmu \
&& make -j \
&& make install \
&& cd /home/openharmony \
&& rm -rf /home/tools/*.tar \
&& rm -rf /home/tools/*.gz \
&& rm -rf /home/tools/*.xz \
&& rm -rf /home/tools/qemu-5.2.0 \
&& npm install -g @ohos/hpm-cli --registry https://mirrors.huaweicloud.com/repository/npm/
ENV LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8
文件模式从 100644 更改为 100755
......@@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
docker build -t openharmony-docker:0.0.7 .
docker build -t openharmony-docker:1.0.0 .
### 0.0.8(2022/01/16)
新增安装doxygen。
### 0.0.7(2022/01/11)
新增安装genext2fs和liblz4-tool。
### 0.0.6(2022/01/04)
新增安装hb。
### 0.0.5(2021/10/28)
新增安装tar、binutils、git-lfs、gnutls-bin、python3.8、python3-pip、cpio。
### 0.0.4(2021/09/18)
1、删除编译依赖的工具预装。
2、增加安装ruby。
### 0.0.3(2021/08/30)
1、更新llvm版本从10.0.1-62608更新到10.0.1-69957。
2、增加安装gcc_aarch64。
### 0.0.2(2021/08/11)
新增安装llvm-10.0.1-62608和restool工具。
### 0.0.1(2021/06/02)
提供OpenHarmony 2.0版本docker编译环境,预装编译依赖工具。
### 0.0.8 (2022/01/16)
Added the installation of doxygen.
### 0.0.7 (2022/01/11)
Added the installation of genext2fs and liblz4-tool.
### 0.0.6 (2022/01/04)
Added the installation of hb.
### 0.0.5 (2021/10/28)
Added the installation of tar, binutils, git-lfs, gnutls-bin, python3.8, python3-pip, and cpio.
### 0.0.4 (2021/09/18)
1\. Removed pre-installed build dependency tools.
2\. Added the Ruby installation.
### 0.0.3 (2021/08/30)
1\. Updated LLVM from 10.0.1-62608 to 10.0.1-69957.
2\. Added the installation of gcc_aarch64.
### 0.0.2 (2021/08/11)
Added the installation of llvm-10.0.1-62608 and restool.
### 0.0.1 (2021/06/02)
Provided a Docker build environment for OpenHarmony 2.0 and pre-installed build dependency tools.
\ No newline at end of file
## Standalone Docker Environment
This document provides guidance on building the Docker image for standard-system devices. For details about how to build the Docker image for mini- and small-system devices, see [OpenHarmony Docker Image](https://gitee.com/openharmony/docs/blob/master/docker/README_en.md)
The 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. 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).
### Setting Up the Docker Environment for Standard-System Devices (reference memory ≥ 128 MB)
1. Obtain the Docker image.
```
docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker-standard:0.0.8
```
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.8
```
### Building for Standard-System Devices (reference memory ≥ 128 MB)
Run the following script to start building for Standard-System Devices (reference memory ≥ 128 MB)
```
./build.sh --product-name {product_name} --ccache
```
**{product_name}** indicates the platform supported by the current distribution, for example, Hi3516DV300, rk3568.
Files generated during compilation are stored in the **out/{device_name}/** directory, and the generated image is stored in the **out/{device_name}/packages/phone/images/** directory.
**Note**
You can exit Docker by simply running the **exit** command.
\ No newline at end of file
## 独立Docker环境
本文为标准系统类设备Docker使用指导,[点此查看](https://gitee.com/openharmony/docs/blob/master/docker/README.md)小型和轻量系统类设备使用指导。
OpenHarmony的Docker镜像托管在HuaweiCloud SWR上。开发者可以通过该镜像在很大程度上简化编译前的环境配置。开发者在配置好开发环境后,通过以下步骤来使用Docker环境。
### 搭建Docker环境-标准系统类设备(参考内存≥128MB)
1. 获取Docker镜像。
```
docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker-standard:0.0.8
```
2. 进入OpenHarmony代码根目录执行如下命令,从而进入Docker构建环境。
```
docker run -it -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker-standard:0.0.8
```
### 编译源码-标准系统类设备(参考内存≥128MB)
通过如下编译脚本启动标准系统类设备(参考内存≥128MB)的编译。
```
./build.sh --product-name {product_name} --ccache
```
{product_name}为当前版本支持的平台。比如:Hi3516DV300、rk3568等。
编译所生成的文件都归档在out/{device_name}/目录下,结果镜像输出在 out/{device_name}/packages/phone/images/ 目录下。
**说明**
退出Docker执行exit命令即可。
\ No newline at end of file
#!/bin/bash
# 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.
docker build -t openharmony-docker-standard:0.0.8 .
# 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:18.04
WORKDIR /home/openharmony
ARG DEBIAN_FRONTEND=noninteractive
ARG PREBUILTS_DIR=/home/prebuilts
ARG HOME_TOOLS=/home/tools
RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak
COPY sources.list /etc/apt
RUN apt-get update \
&& apt-get install -y \
apt-utils \
vim \
tar \
binutils \
software-properties-common \
openssh-server \
iputils-ping \
curl \
net-tools \
bsdmainutils \
kmod \
bc \
rsync \
gawk \
ssh \
ccache \
zip \
python-dev \
make \
m4 \
gcc-multilib \
ca-certificates-java \
unzip \
python3-yaml \
perl \
openssl \
libssl1.1 \
gnupg \
xsltproc \
x11proto-core-dev \
tcl \
python3-crypto \
python-yaml \
python-crypto \
libxml2-utils \
libxml2-dev \
libx11-dev \
libssl-dev \
libgl1-mesa-dev \
lib32z1-dev \
lib32ncurses5-dev \
g++-multilib \
flex \
bison \
doxygen \
git \
git-lfs \
subversion \
tofrodos \
pigz \
expect \
python3-xlrd \
python-xlrd \
wget \
git-core \
gperf \
build-essential \
zlib1g-dev \
libc6-dev-i386 \
lib32z-dev \
openjdk-8-jdk \
ruby \
gnutls-bin \
python3.8 \
python3-pip \
cpio \
genext2fs \
doxygen \
liblz4-tool \
&& 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 \
&& python3 -m pip install --user ohos-build \
&& mkdir -p $PREBUILTS_DIR/prebuilts $HOME_TOOLS
RUN wget -P $HOME_TOOLS https://mirrors.huaweicloud.com/nodejs/v12.18.4/node-v12.18.4-linux-x64.tar.gz \
&& wget -P $HOME_TOOLS https://mirrors.huaweicloud.com/nodejs/v12.18.4/node-v12.18.4-darwin-x64.tar.gz \
&& tar xvf $HOME_TOOLS/node-v12.18.4-linux-x64.tar.gz -C $PREBUILTS_DIR/prebuilts \
&& tar xvf $HOME_TOOLS/node-v12.18.4-darwin-x64.tar.gz -C $PREBUILTS_DIR/prebuilts \
&& sed -i '$aexport PATH='"$PREBUILTS_DIR"'/prebuilts/node-v12.18.4-linux-x64/bin:$PATH' /root/.bashrc \
&& sed -i '$aexport PATH='"$PREBUILTS_DIR"'/prebuilts/hc-gen:$PATH' /root/.bashrc \
&& export PATH=$PATH:$PREBUILTS_DIR/prebuilts/node-v12.18.4-linux-x64/bin \
&& export PATH=$PATH:$PREBUILTS_DIR/prebuilts/hc-gen \
&& rm -rf $HOME_TOOLS \
&& npm install -g @ohos/hpm-cli --registry https://registry.npm.taobao.org
# 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.
deb http://mirrors.ustc.edu.cn/ubuntu/ bionic main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu/ bionic-security main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu/ bionic main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu/ bionic-security main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main multiverse restricted universe
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册