cubefs/docker/Dockerfile-ltp
slasher fc431f6360 chore(ci): remove ltp in docker if no ltptest
Signed-off-by: slasher <shenjie1@oppo.com>
2023-12-28 17:13:05 +08:00

31 lines
1.4 KiB
Plaintext

FROM golang:1.17.13@sha256:87262e4a4c7db56158a80a18fefdc4fee5accc41b59cde821e691d05541bbb18
ENV LTP_VERSION=20210121
ENV LTP_SOURCE=https://github.com/linux-test-project/ltp/archive/${LTP_VERSION}.tar.gz
# install requirements for LTP (Linux Test Program) tests
RUN apt-get update && apt-get install -y xz-utils make gcc-10 g++-10 flex bison automake autoconf psmisc cmake
RUN wget --no-check-certificate https://ocs-cn-north1.heytapcs.com/cubefs/github/ci/rocksdb_libs.tar.gz
RUN mkdir -p /tmp/ltp /opt/ltp && cd /tmp/ltp \
&& wget --no-check-certificate ${LTP_SOURCE} && tar xf ${LTP_VERSION}.tar.gz && cd ltp-${LTP_VERSION} \
&& make autotools && ./configure \
&& make -j "$(getconf _NPROCESSORS_ONLN)" all && make install \
&& rm -rf /tmp/ltp
# install requirements for s3-compatible tests
RUN apt-get install -y sudo python3 python3-pip
RUN pip3 install boto3 unittest2 requests
# install go tools for code format checking
RUN wget --no-check-certificate https://ocs-cn-north1.heytapcs.com/cubefs/github/ci/go_bin.tar.gz
RUN tar -zxf go_bin.tar.gz -C /go/
# prepare env cgo flags
RUN go env -w CGO_CFLAGS="-I/go/src/github.com/cubefs/cubefs/build/include"
RUN go env -w CGO_LDFLAGS="-L/go/src/github.com/cubefs/cubefs/build/lib -lrocksdb -lz -lbz2 -lsnappy -llz4 -lzstd -lstdc++"
# cleanup environment
RUN apt-get install -y jq fuse \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean