-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.centos
36 lines (28 loc) · 1.34 KB
/
Dockerfile.centos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
ARG VERSION=6
FROM centos:${VERSION}
ARG VERSION
ARG WORKUSER=work
ARG WORKSPACE=/${WORKUSER}
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV LANG=en_US.utf8
RUN if [ "$VERSION"x == "8"x ] ; then cd /etc/yum.repos.d/ ; fi
RUN if [ "$VERSION"x == "8"x ] ; then sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* ; fi
RUN if [ "$VERSION"x == "8"x ] ; then sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* ; fi
RUN yum update -y && yum install -y epel-release \
&& yum install -y \
flex bison openssl-devel autoconf gcc-c++ libtool make cmake zlib-devel \
wget curl git file\
&& yum clean all \
&& rm -rf /var/cache/yum
# install bazelisk
RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.7.4/bazelisk-linux-amd64 \
-O /usr/local/bin/bazelisk \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR ${WORKSPACE}
# Prepare Bazel Cache
RUN --mount=type=cache,target=/work/.cache,id=buildcache,sharing=locked \
--mount=type=cache,target=/work/BaikalDB,id=gitcache,sharing=locked \
git clone --branch master --depth 1 https://github.com/baidu/BaikalDB.git \
&& cd BaikalDB && env HOME=${WORKSPACE} USER=${WORKUSER} bazelisk build //:all \
&& cd ${WORKSPACE} && tar cfz bazelcache.tgz -C ${WORKSPACE} .cache