|
| 1 | +# Copyright (C) 2019-2022 Zilliz. All rights reserved. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance |
| 4 | +# with the License. You may obtain a copy of the License at |
| 5 | +# |
| 6 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | +# |
| 8 | +# Unless required by applicable law or agreed to in writing, software distributed under the License |
| 9 | +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
| 10 | +# or implied. See the License for the specific language governing permissions and limitations under the License. |
| 11 | + |
| 12 | +FROM nvidia/cuda:11.6.0-devel-ubuntu20.04 |
| 13 | + |
| 14 | +RUN apt-get update && apt-get install -y --no-install-recommends wget curl ca-certificates gnupg2 && \ |
| 15 | + wget -qO- "https://cmake.org/files/v3.24/cmake-3.24.0-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local && \ |
| 16 | + apt-get update && apt-get install -y --no-install-recommends \ |
| 17 | + g++ gcc gfortran git make ccache libssl-dev zlib1g-dev unzip \ |
| 18 | + clang-format-10 clang-tidy-10 lcov libtool m4 autoconf automake python3 python3-pip \ |
| 19 | + pkg-config uuid-dev libaio-dev libgoogle-perftools-dev libopenblas-dev && \ |
| 20 | + apt-get remove --purge -y && \ |
| 21 | + rm -rf /var/lib/apt/lists/* |
| 22 | + |
| 23 | +RUN pip3 install conan==1.58.0 |
| 24 | + |
| 25 | +# Instal openblas |
| 26 | +# RUN wget https://github.com/xianyi/OpenBLAS/archive/v0.3.21.tar.gz && \ |
| 27 | +# tar zxvf v0.3.21.tar.gz && cd OpenBLAS-0.3.21 && \ |
| 28 | +# make NO_STATIC=1 NO_LAPACK=1 NO_LAPACKE=1 NO_CBLAS=1 NO_AFFINITY=1 USE_OPENMP=1 \ |
| 29 | +# TARGET=HASWELL DYNAMIC_ARCH=1 \ |
| 30 | +# NUM_THREADS=64 MAJOR_VERSION=3 libs shared && \ |
| 31 | +# make PREFIX=/usr/local NUM_THREADS=64 MAJOR_VERSION=3 install && \ |
| 32 | +# rm -f /usr/local/include/cblas.h /usr/local/include/lapack* && \ |
| 33 | +# cd .. && rm -rf OpenBLAS-0.3.21 && rm v0.3.21.tar.gz |
| 34 | + |
| 35 | +ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib" |
| 36 | + |
| 37 | +# Install Go |
| 38 | +ENV GOPATH /go |
| 39 | +ENV GOROOT /usr/local/go |
| 40 | +ENV GO111MODULE on |
| 41 | +ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH |
| 42 | +RUN mkdir -p /usr/local/go && wget -qO- "https://golang.org/dl/go1.18.3.linux-amd64.tar.gz" | tar --strip-components=1 -xz -C /usr/local/go && \ |
| 43 | + mkdir -p "$GOPATH/src" "$GOPATH/bin" && \ |
| 44 | + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${GOPATH}/bin v1.46.2 && \ |
| 45 | + # export GO111MODULE=on && go get github.com/quasilyte/go-ruleguard/cmd/ruleguard@v0.2.1 && \ |
| 46 | + go install github.com/ramya-rao-a/go-outline@latest && \ |
| 47 | + go install golang.org/x/tools/gopls@latest && \ |
| 48 | + go install github.com/uudashr/gopkgs/v2/cmd/gopkgs@latest && \ |
| 49 | + go install github.com/go-delve/delve/cmd/dlv@latest && \ |
| 50 | + go install honnef.co/go/tools/cmd/staticcheck@2022.1 && \ |
| 51 | + go clean --modcache && \ |
| 52 | + chmod -R 777 "$GOPATH" && chmod -R a+w $(go env GOTOOLDIR) |
| 53 | + |
| 54 | +RUN ln -s /go/bin/dlv /go/bin/dlv-dap |
| 55 | + |
| 56 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 57 | + gdb gdbserver && \ |
| 58 | + apt-get remove --purge -y && \ |
| 59 | + rm -rf /var/lib/apt/lists/* |
| 60 | + |
| 61 | +RUN echo 'root:root' | chpasswd |
| 62 | + |
| 63 | +# refer: https://code.visualstudio.com/docs/remote/containers-advanced#_avoiding-extension-reinstalls-on-container-rebuild |
| 64 | +RUN mkdir -p /home/milvus/.vscode-server/extensions \ |
| 65 | + /home/milvus/.vscode-server-insiders/extensions \ |
| 66 | + && chmod -R 777 /home/milvus |
| 67 | + |
| 68 | +COPY --chown=0:0 build/docker/builder/entrypoint.sh / |
| 69 | + |
| 70 | +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 |
| 71 | + |
| 72 | +RUN wget -O /tini https://github.com/krallin/tini/releases/download/v0.19.0/tini && \ |
| 73 | + chmod +x /tini |
| 74 | + |
| 75 | +ENTRYPOINT [ "/tini", "--", "autouseradd", "--user", "milvus", "--", "/entrypoint.sh" ] |
| 76 | +CMD ["tail", "-f", "/dev/null"] |
0 commit comments