Combine docker modes

This commit is contained in:
LINxiansheng
2024-02-08 13:00:32 +00:00
committed by ob-robot
parent b4767c46d6
commit ae4e49c03d
18 changed files with 131 additions and 124 deletions

View File

@ -2,6 +2,7 @@ FROM openanolis/anolisos
# docker build --build-arg VERSION={VERSION} .
ARG VERSION
ARG STEP
RUN yum install -y yum-utils && \
yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo && \
@ -10,6 +11,11 @@ RUN yum install -y yum-utils && \
rm -rf /usr/obd/mirror/remote/* && \
yum clean all
ENV STEP=$STEP
RUN if [ "$STEP" == 1 ]; then \
yum install -y mysql; \
fi
ENV OBVersion=$VERSION
RUN if [ -z "${OBVersion}" ]; then \
echo "VERSION is empty, then build the docker with latest rpm"; \
@ -19,15 +25,16 @@ RUN if [ -z "${OBVersion}" ]; then \
else \
echo "build the docker with VERSION ${OBVersion}"; \
fi && \
mkdir -p /root/pkg && \
mkdir -p /root/pkg && mkdir -p /root/store && mkdir -p /root/dest && \
cd /root/pkg && \
yum install -y --downloadonly --downloaddir=. oceanbase-ce-${OBVersion}.el7 oceanbase-ce-libs-${OBVersion}.el7 obagent ob-configserver && \
rm -rf /usr/obd/mirror/remote/* && \
yum clean all
COPY boot /root/boot/
COPY init_store_for_fast_start.py /root/boot/
ENV PATH /root/boot:$PATH
ENV LD_LIBRARY_PATH /root/ob/lib:$LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH /home/admin/oceanbase/lib:/root/ob/lib:$LD_LIBRARY_PATH
WORKDIR /root
CMD _boot