dockerfile 2.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
# 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.

M
mamingshuai 已提交
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
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 \
C
conglin 已提交
29 30
	tar \
	binutils \
M
mamingshuai 已提交
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
	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 \
C
conglin 已提交
73
	git-lfs \
M
mamingshuai 已提交
74 75 76 77 78 79 80 81 82 83 84 85 86 87
	subversion \
	tofrodos \
	pigz \
	expect \
	python3-xlrd \
	python-xlrd \
	wget \
	git-core \
	gperf \
	build-essential \
	zlib1g-dev \
	libc6-dev-i386 \
	lib32z-dev \
	openjdk-8-jdk \
C
conglin 已提交
88
	ruby \
C
conglin 已提交
89 90 91 92
	gnutls-bin \
	python3.8 \
	python3-pip \
	cpio \
C
conglin 已提交
93
	&& rm -rf /bin/sh /usr/bin/python /usr/bin/python3 \
M
mamingshuai 已提交
94
	&& ln -s /bin/bash /bin/sh \
C
conglin 已提交
95 96 97
	&& 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 \
C
conglin 已提交
98
	&& mkdir -p $PREBUILTS_DIR/prebuilts $HOME_TOOLS
M
mamingshuai 已提交
99 100 101 102 103 104 105 106 107 108 109

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