Skip to content

Commit

Permalink
feat: support building binary for centos7 (GreptimeTeam#1863)
Browse files Browse the repository at this point in the history
feat:support building binary for centos7
  • Loading branch information
v0y4g3r authored Jul 3, 2023
1 parent e54415e commit 2c0c467
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docker/Dockerfile-centos7-builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM centos:7

ENV LANG en_US.utf8
WORKDIR /greptimedb

RUN sed -e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos|g' \
-i.bak \
/etc/yum.repos.d/CentOS-*.repo

# Install dependencies
RUN 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

# 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

CMD ["cargo", "build", "--release"]

0 comments on commit 2c0c467

Please sign in to comment.