Fetch the repository succeeded.
This action will force synchronization from OpenHarmony/build_lite, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
######################################################################################################
##
#OpenHarmony Compile Steps (For 3516D only)
#0. download OpenHarmony dockerFile to your work directory (suggest Docker for Windows)
#1. ssh-keygen -c xxx@xxx.com and upload id_rsa.pub to gitee
#Assume you know SSH-keygen in any OS
# example: ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
# cat /root/.ssh/id_rsa.pub #Paste key to gitee.com on website
#2. put id_rsa same directory with dockerFile
#3. Run powershell / windows terminal, go to dockerfile Directory with a id_rsa key
# docker build -t openharmony:v0.x --build-arg wifiiot --build-arg gitUSERNAME=xxx --build-arg gitPASSWORD=xxx --build-arg gitUSEREMAIL=xxx@xxx.com .
#4. run the compiled docker image and copy OHOS images
# docker run -ti -d --name openharmony_compiled openharmony:v0.x bash
# docker cp openharmony:/OpenHarmony/out/ipcamera_hi3516dv300/OHOS_Image.bin .
# docker cp openharmony:/OpenHarmony/out/ipcamera_hi3516dv300/rootfs.img .
# docker cp openharmony:/OpenHarmony/out/ipcamera_hi3516dv300/userfs.img .
#5. Get into Docker if you need
# docker attach openharmony_compiled
##################################################################################################
FROM ubuntu:18.04 AS build-env
LABEL version=v0.1
#Set your hardware
ARG HARDWARE=ipcamera_hi3516dv300
#Get arg and set default value
ARG gitUSERNAME=xxx
ARG gitUSEREMAIL=xxx@163.com
ARG gitUSERPASSEWORD=xxxxx
#Init variables
ENV username=${gitUSERNAME}
ENV useremail=${gitUSEREMAIL}
ENV userpassword=${gitUSERPASSEWORD}
# Setting up the build environment
RUN sed -i 's/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list && \
sed -i 's/security.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list && \
apt-get clean -y && \
apt-get -y update && \
#apt-get -y dist-upgrade && \
apt-get remove python* -y && \
apt-get install git curl build-essential libdbus-glib-1-dev libgirepository1.0-dev -y && \
apt-get install zip libncurses5-dev pkg-config -y && \
apt-get install python3.8 python3-pip -y && \
apt-get install scons dosfstools mtools -y && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1 && \
#Make sure python install on the right python version path
python -m pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple && \
python -m pip install ninja kconfiglib pycryptodome ecdsa -i https://mirrors.aliyun.com/pypi/simple && \
python -m pip install six --upgrade --ignore-installed six -i https://pypi.tuna.tsinghua.edu.cn/simple && \
rm -rf /var/cache/apt/archives
#Fix Dash
RUN rm -rf /bin/sh && \
ln -s /bin/bash /bin/sh
#Setup gn
RUN mkdir /tools && \
cd /tools && \
curl -LO https://repo.huaweicloud.com/harmonyos/compiler/gn/1523/linux/gn.1523.tar && \
tar xvf /tools/gn.1523.tar && \
chmod a+x /tools/gn && \
mv gn/gn /usr/bin/gn
#Setup LLVM
#ADD ./llvm-linux-9.0.0-34042.tar /tools
RUN cd /tools && \
curl -LO https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar && \
tar xvf /tools/llvm-linux-9.0.0-34042.tar && \
echo "export PATH=/tools/llvm/bin:$PATH" >> /etc/profile
ENV PATH /tools/llvm/bin:$PATH
#Setup hc-gen
RUN cd /tools && \
curl -LO https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar && \
tar xvf /tools/hc-gen-0.65-linux.tar && \
echo "export PATH=/tools/hc-gen:$PATH" >> /etc/profile
ENV PATH /tools/hc-gen:$PATH
#Setup gcc_riscv32
RUN cd /tools && \
curl -LO https://repo.huaweicloud.com/harmonyos/compiler/gcc_riscv32/7.3.0/linux/gcc_riscv32-linux-7.3.0.tar.gz && \
tar xvf /tools/gcc_riscv32-linux-7.3.0.tar.gz && \
echo "export PATH=/tools/gcc_riscv32/bin:$PATH" >> /etc/profile
ENV PATH /tools/gcc_riscv32/bin:$PATH
#Create work dir
RUN mkdir /OpenHarmony
WORKDIR /OpenHarmony
#Copy your gitee SSH private key into Docker (Assume your public already on gitee)
COPY ./id_rsa /root/.ssh/id_rsa
#Using google version repo
#RUN apt-get install -y repo && \
# sed -i 's/gerrit.googlesource.com/mirrors.tuna.tsinghua.edu.cn\/git/g' /usr/bin/repo
# Gitee Repo tool and download
RUN curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/bin/repo && \
chmod a+x /usr/bin/repo && \
#Make sure requests install at the right location
python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple requests
#Download source, update to your info
RUN git config --global user.email "${useremail}" && \
git config --global user.name "${username}" && \
git config --global color.ui false && \
git config --global credential.helper store && \
repo init -u https://${username}:${userpassword}@gitee.com/openharmony/manifest.git -b master --repo-branch=stable --no-repo-verify && \
repo sync -c
# compile
#RUN python build.py ipcamera_hi3516dv300 -b debug
ENV LANGUAGE en
ENV LANG en_US.utf-8
RUN export|grep LANG
RUN ["/bin/bash", "-c", "source /etc/profile; python build.py ${HARDWARE} -b debug"]
# build final docker image
FROM ubuntu:18.04
RUN sed -i 's/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list && \
sed -i 's/security.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list && \
apt-get -y update && \
apt-get install -y curl vim python3.8 && \
rm -rf /var/cache/apt/archives
COPY --from=build-env /OpenHarmony /OpenHarmony
VOLUME /OpenHarmony
ENV PATH=/OpenHarmony/bin:$PATH
#CMD python build.py ipcamera_hi3516dv300 -b debug
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。