From 6eeaa267689f9e6de152b6dab8cdb3ff90485a9e Mon Sep 17 00:00:00 2001 From: shouren Date: Wed, 4 Dec 2024 18:52:37 +0800 Subject: [PATCH] feat: Add new Dockerfile base on Ubuntu:22.04 --- docker/Dockerfile | 31 +++++++--------------- docker/centos-7.Dockerfile | 53 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 22 deletions(-) create mode 100644 docker/centos-7.Dockerfile diff --git a/docker/Dockerfile b/docker/Dockerfile index 37027cd43cc..3c2df3b4823 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -12,42 +12,29 @@ # See the License for the specific language governing permissions and # limitations under the License. - -FROM centos:7 +FROM ubuntu:22.04 ARG ZETASQL_VERSION=0.3.4 -ARG THIRDPARTY_VERSION=0.7.0 +ARG THIRDPARTY_VERSION=0.7.1 ARG TARGETARCH + LABEL org.opencontainers.image.source https://github.com/4paradigm/OpenMLDB COPY ./*.sh / -# hadolint ignore=DL3031,DL3033 -RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo && \ - sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo && \ - sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo && \ - yum update -y && yum install -y centos-release-scl epel-release && \ - /patch_yum_repo.sh && \ - yum install -y devtoolset-8 rh-git227 devtoolset-8-libasan-devel flex doxygen java-1.8.0-openjdk-devel rh-python38-python-devel rh-python38-python-wheel rh-python38-python-requests rh-python38-python-pip && \ - curl -Lo lcov-1.15-1.noarch.rpm https://github.com/linux-test-project/lcov/releases/download/v1.15/lcov-1.15-1.noarch.rpm && \ - yum localinstall -y lcov-1.15-1.noarch.rpm && \ - yum clean all && rm -v lcov-1.15-1.noarch.rpm && \ + +RUN apt update -y && \ + apt install -y build-essential python3-dev openjdk-11-jdk flex doxygen lcov git && \ + apt clean cache && \ curl -Lo zookeeper.tar.gz https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz && \ mkdir -p /deps/src && \ tar xzf zookeeper.tar.gz -C /deps/src && \ - rm -v ./*.tar.gz && \ - /setup_deps.sh -a "$TARGETARCH" -z "$ZETASQL_VERSION" -t "$THIRDPARTY_VERSION" && \ + /setup_deps.sh -z "$ZETASQL_VERSION" -t "$THIRDPARTY_VERSION" && \ rm -v /*.sh ENV THIRD_PARTY_DIR=/deps/usr ENV THIRD_PARTY_SRC_DIR=/deps/src -ENV PATH=/opt/rh/rh-git227/root/usr/bin:/opt/rh/rh-python38/root/usr/local/bin:/opt/rh/rh-python38/root/usr/bin:/opt/rh/devtoolset-8/root/usr/bin:/deps/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -ENV LD_LIBRARY_PATH=/deps/usr/lib:/deps/usr/lib64:/opt/rh/httpd24/root/usr/lib64:/opt/rh/rh-python38/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/rh/devtoolset-8/root/usr/lib64/dyninst +ENV LD_LIBRARY_PATH=/deps/usr/lib:/deps/usr/lib64:$LD_LIBRARY_PATH ENV LANG=en_US.UTF-8 ENV ZETASQL_VERSION=$ZETASQL_VERSION ENV THIRDPARTY_VERSION=$THIRDPARTY_VERSION - -WORKDIR /root - -CMD [ "/bin/bash" ] - diff --git a/docker/centos-7.Dockerfile b/docker/centos-7.Dockerfile new file mode 100644 index 00000000000..37027cd43cc --- /dev/null +++ b/docker/centos-7.Dockerfile @@ -0,0 +1,53 @@ +# Copyright 2021 4Paradigm +# +# 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 centos:7 + +ARG ZETASQL_VERSION=0.3.4 +ARG THIRDPARTY_VERSION=0.7.0 +ARG TARGETARCH + +LABEL org.opencontainers.image.source https://github.com/4paradigm/OpenMLDB + +COPY ./*.sh / +# hadolint ignore=DL3031,DL3033 +RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo && \ + sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo && \ + sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo && \ + yum update -y && yum install -y centos-release-scl epel-release && \ + /patch_yum_repo.sh && \ + yum install -y devtoolset-8 rh-git227 devtoolset-8-libasan-devel flex doxygen java-1.8.0-openjdk-devel rh-python38-python-devel rh-python38-python-wheel rh-python38-python-requests rh-python38-python-pip && \ + curl -Lo lcov-1.15-1.noarch.rpm https://github.com/linux-test-project/lcov/releases/download/v1.15/lcov-1.15-1.noarch.rpm && \ + yum localinstall -y lcov-1.15-1.noarch.rpm && \ + yum clean all && rm -v lcov-1.15-1.noarch.rpm && \ + curl -Lo zookeeper.tar.gz https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz && \ + mkdir -p /deps/src && \ + tar xzf zookeeper.tar.gz -C /deps/src && \ + rm -v ./*.tar.gz && \ + /setup_deps.sh -a "$TARGETARCH" -z "$ZETASQL_VERSION" -t "$THIRDPARTY_VERSION" && \ + rm -v /*.sh + +ENV THIRD_PARTY_DIR=/deps/usr +ENV THIRD_PARTY_SRC_DIR=/deps/src +ENV PATH=/opt/rh/rh-git227/root/usr/bin:/opt/rh/rh-python38/root/usr/local/bin:/opt/rh/rh-python38/root/usr/bin:/opt/rh/devtoolset-8/root/usr/bin:/deps/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV LD_LIBRARY_PATH=/deps/usr/lib:/deps/usr/lib64:/opt/rh/httpd24/root/usr/lib64:/opt/rh/rh-python38/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/rh/devtoolset-8/root/usr/lib64/dyninst +ENV LANG=en_US.UTF-8 +ENV ZETASQL_VERSION=$ZETASQL_VERSION +ENV THIRDPARTY_VERSION=$THIRDPARTY_VERSION + +WORKDIR /root + +CMD [ "/bin/bash" ] +