mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-28 00:42:56 +00:00
* refactor: use '--output type=local' in 'build-greptime-by-buildx' target to reduce unnecessary 'docker cp'" Signed-off-by: zyy17 <zyylsxm@gmail.com> * refactor: improve the image building performance * ci: release centos dev builder * ci: use 'make build-by-dev-builder' to improve docker build performance * refactor: add 'which' command in centos * fix: add 'OUTPUT_DIR' to fix 'make docker-image-buildx' error * fix: fix incorrect dockerfile path Signed-off-by: zyy17 <zyylsxm@gmail.com> * refactor: remove configure-aws-credentials action and use env variables Signed-off-by: zyy17 <zyylsxm@gmail.com> * ci: update slack notification prompt * refactor: clean up the target directory before building artifacts of centos7 --------- Signed-off-by: zyy17 <zyylsxm@gmail.com>
55 lines
1.4 KiB
Docker
55 lines
1.4 KiB
Docker
FROM centos:7 as builder
|
|
|
|
ARG CARGO_PROFILE
|
|
ARG FEATURES
|
|
ARG OUTPUT_DIR
|
|
|
|
ENV LANG en_US.utf8
|
|
WORKDIR /greptimedb
|
|
|
|
# Install dependencies
|
|
RUN ulimit -n 1024000 && yum groupinstall -y 'Development Tools'
|
|
RUN yum install -y epel-release \
|
|
openssl \
|
|
openssl-devel \
|
|
centos-release-scl \
|
|
rh-python38 \
|
|
rh-python38-python-devel \
|
|
which
|
|
|
|
# Install protoc
|
|
RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip
|
|
RUN unzip protoc-3.15.8-linux-x86_64.zip -d /usr/local/
|
|
|
|
# Install Rust
|
|
SHELL ["/bin/bash", "-c"]
|
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain none -y
|
|
ENV PATH /opt/rh/rh-python38/root/usr/bin:/usr/local/bin:/root/.cargo/bin/:$PATH
|
|
|
|
# Build the project in release mode.
|
|
RUN --mount=target=.,rw \
|
|
--mount=type=cache,target=/root/.cargo/registry \
|
|
make build \
|
|
CARGO_PROFILE=${CARGO_PROFILE} \
|
|
FEATURES=${FEATURES} \
|
|
TARGET_DIR=/out/target
|
|
|
|
# Export the binary to the clean image.
|
|
FROM centos:7 as base
|
|
|
|
ARG OUTPUT_DIR
|
|
|
|
RUN yum install -y epel-release \
|
|
openssl \
|
|
openssl-devel \
|
|
centos-release-scl \
|
|
rh-python38 \
|
|
rh-python38-python-devel \
|
|
which
|
|
|
|
WORKDIR /greptime
|
|
COPY --from=builder /out/target/${OUTPUT_DIR}/greptime /greptime/bin/
|
|
ENV PATH /greptime/bin/:$PATH
|
|
|
|
ENTRYPOINT ["greptime"]
|