milvus/build/docker/builder/cpu/centos7/Dockerfile
Jiquan Long 3353da7c94
Add m4 and autoconf to builder image (#16228)
Signed-off-by: dragondriver <jiquan.long@zilliz.com>
2022-03-28 21:29:27 +08:00

79 lines
3.7 KiB
Docker

# Copyright (C) 2019-2020 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under the License.
FROM milvusdb/openblas:centos7-20210706
RUN yum install -y epel-release centos-release-scl-rh && yum install -y wget curl which && \
wget -qO- "https://cmake.org/files/v3.18/cmake-3.18.6-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local && \
yum install -y git make automake openssl-devel zlib-devel \
libcurl-devel python3-devel \
devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-gcc-gfortran \
llvm-toolset-7.0-clang llvm-toolset-7.0-clang-tools-extra \
ccache lcov libtool m4 autoconf && \
rm -rf /var/cache/yum/* && \
echo "source scl_source enable devtoolset-7" >> /etc/profile.d/devtoolset-7.sh && \
echo "source scl_source enable llvm-toolset-7.0" >> /etc/profile.d/llvm-toolset-7.sh
ENV CLANG_TOOLS_PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin"
# Install tbb
RUN source /etc/profile.d/devtoolset-7.sh && \
git clone https://github.com/wjakob/tbb.git && \
cd tbb/build && \
cmake .. && make -j && make install && \
cd ../../ && rm -rf tbb/
# Install boost
RUN source /etc/profile.d/devtoolset-7.sh && \
wget -q https://boostorg.jfrog.io/artifactory/main/release/1.65.1/source/boost_1_65_1.tar.gz && \
tar zxf boost_1_65_1.tar.gz && cd boost_1_65_1 && \
./bootstrap.sh --prefix=/usr/local --with-toolset=gcc --without-libraries=python && \
./b2 -j2 --prefix=/usr/local --without-python toolset=gcc install && \
cd ../ && rm -rf ./boost_1_65_1*
ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH
# Install Go
ENV GOPATH /go
ENV GOROOT /usr/local/go
ENV GO111MODULE on
ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH
RUN mkdir -p /usr/local/go && wget -qO- "https://golang.org/dl/go1.16.9.linux-amd64.tar.gz" | tar --strip-components=1 -xz -C /usr/local/go && \
mkdir -p "$GOPATH/src" "$GOPATH/bin" && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${GOPATH}/bin v1.43.0 && \
export GO111MODULE=on && go get github.com/quasilyte/go-ruleguard/cmd/ruleguard@v0.2.1 && \
go get -v github.com/ramya-rao-a/go-outline && \
go get -v golang.org/x/tools/gopls && \
go get -v github.com/uudashr/gopkgs/v2/cmd/gopkgs && \
go get -v github.com/go-delve/delve/cmd/dlv && \
go get -v honnef.co/go/tools/cmd/staticcheck && \
go clean --modcache && \
chmod -R 777 "$GOPATH" && chmod -R a+w $(go env GOTOOLDIR)
RUN ln -s /go/bin/dlv /go/bin/dlv-dap
RUN echo 'root:root' | chpasswd
# refer: https://code.visualstudio.com/docs/remote/containers-advanced#_avoiding-extension-reinstalls-on-container-rebuild
RUN mkdir -p /home/milvus/.vscode-server/extensions \
/home/milvus/.vscode-server-insiders/extensions \
&& chmod -R 777 /home/milvus
COPY --chown=0:0 build/docker/builder/entrypoint.sh /
RUN wget -qO- "https://github.com/jeffoverflow/autouseradd/releases/download/1.2.0/autouseradd-1.2.0-amd64.tar.gz" | tar xz -C / --strip-components 1
RUN wget -O /tini https://github.com/krallin/tini/releases/download/v0.19.0/tini && \
chmod +x /tini
ENTRYPOINT [ "/tini", "--", "autouseradd", "--user", "milvus", "--", "/entrypoint.sh" ]
CMD ["tail", "-f", "/dev/null"]