[Docker] update docker hub url to official repo (#5972)

This commit is contained in:
Zhengguo Yang
2021-06-06 22:08:21 +08:00
committed by GitHub
parent 60062d97da
commit 8ea0ae4792
6 changed files with 53 additions and 60 deletions

View File

@ -17,35 +17,22 @@
FROM centos:7 AS builder
# install gcc-10 repo
RUN echo $'\
[ol7_software_collections]\n\
name=Software Collection packages for Oracle Linux 7 ($basearch)\n\
baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/SoftwareCollections/$basearch/\n\
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle\n\
gpgcheck=1\n\
enabled=1' >> /etc/yum.repos.d/CentOS-SCLo-scl.ol.repo
# install dependencies
RUN yum makecache && yum -y update && yum -y groupinstall 'Development Tools' && \
yum install -y byacc automake java-11-openjdk-devel libtool bison binutils-devel zip unzip \
ncurses-devel curl git wget python2 glibc-static libstdc++-static which psl libpsl-devel
# install gcc10
RUN wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle && \
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-* && \
yum install -y devtoolset-10-gcc* devtoolset-10-libubsan-devel devtoolset-10-liblsan-devel devtoolset-10-libasan-devel
ENV JAVA_HOME="/usr/lib/jvm/java-11"
yum install -y byacc automake java-11-openjdk-devel java-1.8.0-openjdk-devel libtool bison binutils-devel zip \
unzip ncurses-devel curl git wget python2 glibc-static java-1.8.0-openjdk-devel \
libstdc++-static which psl libpsl-devel centos-release-scl && \
yum install -y devtoolset-10 devtoolset-10-gcc devtoolset-10-libubsan-devel devtoolset-10-liblsan-devel \
devtoolset-10-libasan-devel
# build cmake
ARG CMAKE_VERSION=3.19.4
ARG CMAKE_VERSION=3.19.8
ARG CMAKE_BASE_URL=https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}
RUN wget ${CMAKE_BASE_URL}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh -q -O /tmp/cmake-install.sh && \
chmod u+x /tmp/cmake-install.sh && \
/tmp/cmake-install.sh --skip-license --prefix=/usr --exclude-subdir && \
rm /tmp/cmake-install.sh
# build ninja
ARG NINJA_VER=1.10.2
ARG NINJA_BASE_URL=https://github.com/ninja-build/ninja/releases/download/v${NINJA_VER}
@ -57,13 +44,11 @@ RUN wget -q ${NINJA_BASE_URL}/ninja-linux.zip -O /tmp/ninja-linux.zip && \
ARG MAVEN_VERSION=3.6.3
ARG MAVEN_BASE_URL=https://downloads.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries
RUN mkdir -p /usr/share/maven /usr/share/maven/ref && \
curl -fsSL -o /tmp/apache-maven.tar.gz ${MAVEN_BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz && \
wget -q -O /tmp/apache-maven.tar.gz ${MAVEN_BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz && \
tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 && \
rm -f /tmp/apache-maven.tar.gz && \
ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
ENV MAVEN_HOME /usr/share/maven
# build flex
ARG FLEX_VERSION=2.6.4
RUN wget https://github.com/westes/flex/releases/download/v$FLEX_VERSION/flex-$FLEX_VERSION.tar.gz \
@ -92,7 +77,8 @@ ENV BASH_ENV=/opt/rh/devtoolset-10/enable \
# there is a repo which is included all of thirdparty
ENV REPOSITORY_URL=https://doris-thirdparty-repo.bj.bcebos.com/thirdparty
ENV DEFAULT_DIR /var/local
ENV DEFAULT_DIR=/var/local
ENV JAVA_HOME="/usr/lib/jvm/java-11"
# clone lastest source code, download and build third party
COPY incubator-doris ${DEFAULT_DIR}/incubator-doris
@ -104,22 +90,20 @@ RUN cd ${DEFAULT_DIR}/incubator-doris && /bin/bash thirdparty/build-thirdparty.s
&& mv ${DEFAULT_DIR}/incubator-doris/thirdparty/installed ${DEFAULT_DIR}/thirdparty/ \
&& rm -rf ${DEFAULT_DIR}/incubator-doris
RUN alternatives --set java java-11-openjdk.x86_64 && alternatives --set javac java-11-openjdk.x86_64
FROM scratch
COPY --from=builder / /
ENV JAVA_HOME="/usr/lib/jvm/java-11"
ENV MAVEN_HOME /usr/share/maven
ENV BASH_ENV=/opt/rh/devtoolset-10/enable \
ENV=/opt/rh/devtoolset-10/enable \
PROMPT_COMMAND=". /opt/rh/devtoolset-10/enable"
ENV REPOSITORY_URL=https://doris-thirdparty-repo.bj.bcebos.com/thirdparty
ENV DEFAULT_DIR /var/local
ENV DORIS_THIRDPARTY /var/local/thirdparty
ENV JAVA_HOME="/usr/lib/jvm/java-11" \
MAVEN_HOME="/usr/share/maven" \
BASH_ENV="/opt/rh/devtoolset-10/enable" \
ENV="/opt/rh/devtoolset-10/enable" \
PROMPT_COMMAND=". /opt/rh/devtoolset-10/enable" \
REPOSITORY_URL="https://doris-thirdparty-repo.bj.bcebos.com/thirdparty" \
DEFAULT_DIR="/var/local" \
PATH="/var/local/thirdparty/installed/bin:$PATH" \
DORIS_THIRDPARTY="/var/local/thirdparty"
WORKDIR /root
CMD ["/bin/bash"]

View File

@ -94,5 +94,14 @@ $ cd /root/incubator-doris/
$ sh build.sh
```
The default JDK version is openjdk 11, if you want to use openjdk 8, you can run the command:
```console
$ alternatives --set java java-1.8.0-openjdk.x86_64
$ alternatives --set javac java-1.8.0-openjdk.x86_64
$ export JAVA_HOME=/usr/lib/jvm/java-1.8.0
```
[1]: https://www.oracle.com/technetwork/java/javase/downloads/index.html
[2]: https://nodejs.org/dist/v14.8.0/

View File

@ -305,7 +305,7 @@ After the entire branch is stable, the release can be prepared.
1. Download the compiled image
```
docker pull apachedoris/doris-dev:build-env-1.2
docker pull apache/incubator-doris:build-env-1.2
```
2. Use official documents to compile the new branch, see [Docker Development Mirror Compilation](http://doris.apache.org/master/zh-CN/installing/compilation.html)
@ -513,12 +513,12 @@ To verify and build, you can refer to following instruction:
Firstly, you must be install and start docker service, and then you could build Doris as following steps:
Step1: Pull the docker image with Doris building environment
$ docker pull apachedoris/doris-dev:build-env
$ docker pull apache/incubator-doris:build-env-1.3
You can check it by listing images, its size is about 3.28GB.
Step2: Run the Docker image
You can run image directly:
$ docker run -it apachedoris/doris-dev:build-env
$ docker run -it apache/incubator-doris:build-env-1.3
Step3: Download Doris source
Now you should in docker environment, and you can download Doris source package.

View File

@ -35,37 +35,37 @@ This document focuses on how to code Doris through source code.
1. Download Docker Mirror
`$ docker pull apachedoris/doris-dev:build-env`
`$ docker pull apache/incubator-doris:build-env-1.3`
Check mirror download completed:
```
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
apachedoris/doris-dev build-env f8bc5d4024e0 21 hours ago 3.28GB
apache/incubator-doris build-env-1.3 ca207367c09f 21 hours ago 3.28GB
```
Note: For different versions of Oris, you need to download the corresponding mirror version.
| image version | commit id | release version |
|---|---|---|
| apachedoris/doris-dev:build-env | before [ff0dd0d](https://github.com/apache/incubator-doris/commit/ff0dd0d2daa588f18b6db56f947e813a56d8ec81) | 0.8.x, 0.9.x |
| apachedoris/doris-dev:build-env-1.1 | [ff0dd0d](https://github.com/apache/incubator-doris/commit/ff0dd0d2daa588f18b6db56f947e813a56d8ec81) or later | 0.10.x or later |
| apachedoris/doris-dev:build-env-1.2 | [4ef5a8c](https://github.com/apache/incubator-doris/commit/4ef5a8c8560351d7fff7ff8fd51c4c7a75e006a8) or later | 0.12.x - 0.14.0 |
| apachedoris/doris-dev:build-env-1.3 | [ad67dd3](https://github.com/apache/incubator-doris/commit/ad67dd34a04c1ca960cff38e5b335b30fc7d559f) or later | later |
| apache/incubator-doris:build-env | before [ff0dd0d](https://github.com/apache/incubator-doris/commit/ff0dd0d2daa588f18b6db56f947e813a56d8ec81) | 0.8.x, 0.9.x |
| apache/incubator-doris:build-env-1.1 | [ff0dd0d](https://github.com/apache/incubator-doris/commit/ff0dd0d2daa588f18b6db56f947e813a56d8ec81) or later | 0.10.x or later |
| apache/incubator-doris:build-env-1.2 | [4ef5a8c](https://github.com/apache/incubator-doris/commit/4ef5a8c8560351d7fff7ff8fd51c4c7a75e006a8) or later | 0.12.x - 0.14.0 |
| apache/incubator-doris:build-env-1.3 | [ad67dd3](https://github.com/apache/incubator-doris/commit/ad67dd34a04c1ca960cff38e5b335b30fc7d559f) or later | later |
Warning: Doris 0.14.0 still used apachedoris/doris-dev:build-env-1.2 to compile. After thie version, the code will use apachedoris/doris-dev:build-env-1.3 to compile . **In the docker image of build-env-1.3, the default JDK version is upgraded to 11. So FE will use OPENJDK 11 to compile. If the docker image after build-env-1.3 is used for compilation of FE, the Java version of FE running env also needs to be upgraded to JDK11, Otherwise unexpected running errors may be caused. **
Warning: Doris 0.14.0 still used apache/incubator-doris:build-env-1.2 to compile. After thie version, the code will use apache/incubator-doris:build-env-1.3 to compile . **In the docker image of build-env-1.3, the default JDK version is upgraded to 11. So FE will use OPENJDK 11 to compile. If the docker image after build-env-1.3 is used for compilation of FE, the Java version of FE running env also needs to be upgraded to JDK11, Otherwise unexpected running errors may be caused. **
2. Running Mirror
`$ docker run -it apachedoris/doris-dev:build-env`
`$ docker run -it apache/incubator-doris:build-env-1.3`
It is recommended to run the container by mounting the local Doris source directory, so that the compiled binary file will be stored in the host machine and will not disappear because the container exits.
At the same time, it is recommended to mount the maven `.m2` directory in the mirror to the host directory at the same time to prevent repeated downloading of maven's dependent libraries each time the compilation is started.
```
$ docker run -it -v /your/local/.m2:/root/.m2 -v /your/local/incubator-doris-DORIS-x.x.x-release/:/root/incubator-doris-DORIS-x.x.x-release/ apachedoris/doris-dev:build-env
$ docker run -it -v /your/local/.m2:/root/.m2 -v /your/local/incubator-doris-DORIS-x.x.x-release/:/root/incubator-doris-DORIS-x.x.x-release/ apache/incubator-doris:build-env-1.3
```
3. Download source code

View File

@ -294,7 +294,7 @@ $ git checkout -b branch-0.9
1. 下载编译镜像
```
docker pull apachedoris/doris-dev:build-env-1.2
docker pull apache/incubator-doris:build-env-1.2
```
2. 使用官方文档编译新分支,编译方式见[Docker 开发镜像编译](http://doris.apache.org/master/zh-CN/installing/compilation.html)
@ -497,12 +497,12 @@ To verify and build, you can refer to following instruction:
Firstly, you must be install and start docker service, and then you could build Doris as following steps:
Step1: Pull the docker image with Doris building environment
$ docker pull apachedoris/doris-dev:build-env
$ docker pull apache/incubator-doris:build-env-1.3
You can check it by listing images, its size is about 3.28GB.
Step2: Run the Docker image
You can run image directly:
$ docker run -it apachedoris/doris-dev:build-env
$ docker run -it apache/incubator-doris:build-env-1.3
Step3: Download Doris source
Now you should in docker environment, and you can download Doris source package.

View File

@ -34,14 +34,14 @@ under the License.
1. 下载 Docker 镜像
`$ docker pull apachedoris/doris-dev:build-env`
`$ docker pull apache/incubator-doris:build-env-1.3`
检查镜像下载完成:
```
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
apachedoris/doris-dev build-env f8bc5d4024e0 21 hours ago 3.28GB
apache/incubator-doris build-env-1.3 ca207367c09f 21 hours ago 3.28GB
```
@ -49,23 +49,23 @@ under the License.
| 镜像版本 | commit id | doris 版本 |
|---|---|---|
| apachedoris/doris-dev:build-env | before [ff0dd0d](https://github.com/apache/incubator-doris/commit/ff0dd0d2daa588f18b6db56f947e813a56d8ec81) | 0.8.x, 0.9.x |
| apachedoris/doris-dev:build-env-1.1 | [ff0dd0d](https://github.com/apache/incubator-doris/commit/ff0dd0d2daa588f18b6db56f947e813a56d8ec81) | 0.10.x, 0.11.x |
| apachedoris/doris-dev:build-env-1.2 | [4ef5a8c](https://github.com/apache/incubator-doris/commit/4ef5a8c8560351d7fff7ff8fd51c4c7a75e006a8) | 0.12.x - 0.14.0 |
| apachedoris/doris-dev:build-env-1.3 | [ad67dd3](https://github.com/apache/incubator-doris/commit/ad67dd34a04c1ca960cff38e5b335b30fc7d559f) | 后续的发布版本 |
| apache/incubator-doris:build-env | before [ff0dd0d](https://github.com/apache/incubator-doris/commit/ff0dd0d2daa588f18b6db56f947e813a56d8ec81) | 0.8.x, 0.9.x |
| apache/incubator-doris:build-env-1.1 | [ff0dd0d](https://github.com/apache/incubator-doris/commit/ff0dd0d2daa588f18b6db56f947e813a56d8ec81) | 0.10.x, 0.11.x |
| apache/incubator-doris:build-env-1.2 | [4ef5a8c](https://github.com/apache/incubator-doris/commit/4ef5a8c8560351d7fff7ff8fd51c4c7a75e006a8) | 0.12.x - 0.14.0 |
| apache/incubator-doris:build-env-1.3 | [ad67dd3](https://github.com/apache/incubator-doris/commit/ad67dd34a04c1ca960cff38e5b335b30fc7d559f) | 后续的发布版本 |
注意: doris 0.14.0 版本仍然使用apachedoris/doris-dev:build-env-1.2 编译,之后的代码将使用apachedoris/doris-dev:build-env-1.3。**在build-env-1.3的docker镜像中,默认的JDK的版本升级到了11,所以FE将会使用OpenJDK 11进行编译。如果使用build-env-1.3之后的docker镜像进行FE编译的话,后续运行FE的Java版本也需要同时升级到JDK11,否则可能导致非预期的运行错误。**
注意: doris 0.14.0 版本仍然使用apache/incubator-doris:build-env-1.2 编译,之后的代码将使用apache/incubator-doris:build-env-1.3。**在build-env-1.3的docker镜像中,默认的JDK的版本升级到了11,所以FE将会使用OpenJDK 11进行编译。如果使用build-env-1.3之后的docker镜像进行FE编译的话,后续运行FE的Java版本也需要同时升级到JDK11,否则可能导致非预期的运行错误。**
2. 运行镜像
`$ docker run -it apachedoris/doris-dev:build-env`
`$ docker run -it apache/incubator-doris:build-env-1.3`
建议以挂载本地 Doris 源码目录的方式运行镜像,这样编译的产出二进制文件会存储在宿主机中,不会因为镜像退出而消失。
同时,建议同时将镜像中 maven 的 `.m2` 目录挂载到宿主机目录,以防止每次启动镜像编译时,重复下载 maven 的依赖库。
```
$ docker run -it -v /your/local/.m2:/root/.m2 -v /your/local/incubator-doris-DORIS-x.x.x-release/:/root/incubator-doris-DORIS-x.x.x-release/ apachedoris/doris-dev:build-env
$ docker run -it -v /your/local/.m2:/root/.m2 -v /your/local/incubator-doris-DORIS-x.x.x-release/:/root/incubator-doris-DORIS-x.x.x-release/ apachedoris/doris-dev:build-env-1.3
```
3. 下载源码