-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile_base
94 lines (77 loc) · 4.21 KB
/
Dockerfile_base
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Copyright 2018-2021 (c) Cognizant Digital Business, Evolutionary AI. All rights reserved. Issued under the Apache 2.0 License.
#
FROM ubuntu:20.04
MAINTAINER [email protected]
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
ENV CUDA_PACKAGE_VERSION 11-2
ENV CUDA_FILESYS_VERSION 11.2
ENV NVIDIA_VERSION 465
RUN apt-get update && \
apt-get install -y locales && \
apt-get install -y language-pack-en && \
update-locale "en_US.UTF-8" && \
apt-get install -y --no-install-recommends ca-certificates apt-transport-https apt-utils && \
apt-get install -y --no-install-recommends openssl ssh wget curl lshw jq htop vim pkg-config unzip gnupg2 && \
apt-get install -y --no-install-recommends libopenblas-base && \
apt-get -y upgrade && \
apt-get clean
RUN mkdir /usr/lib/nvidia && \
cd /tmp && \
apt-get install -y freeglut3 freeglut3-dev libxi-dev libxmu-dev && \
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub && \
wget -q -O /etc/apt/preferences.d/cuda-repository-pin-600 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin && \
wget -q -O /tmp/cuda.deb https://developer.download.nvidia.com/compute/cuda/11.2.2/local_installers/cuda-repo-ubuntu2004-11-2-local_11.2.2-460.32.03-1_amd64.deb && \
dpkg -i /tmp/cuda.deb && \
apt-get -y update
RUN \
apt list nvidia-\* &&\
apt list cuda-\* &&\
apt-get -y install --no-install-recommends cuda-command-line-tools-${CUDA_PACKAGE_VERSION} && \
apt-get -y install --no-install-recommends cuda-libraries-${CUDA_PACKAGE_VERSION} && \
apt-get -y install --no-install-recommends cuda-libraries-dev-${CUDA_PACKAGE_VERSION} && \
apt-get -y install --no-install-recommends cuda-nvml-dev-${CUDA_PACKAGE_VERSION} && \
apt-get clean
RUN \
ls /usr/lib | grep nvidia && \
ln -s /usr/local/cuda-${CUDA_FILESYS_VERSION} /usr/local/cuda && \
ln -s /usr/local/cuda/targets/x86_64-linux/include /usr/local/cuda/include && \
ln -s /usr/lib/nvidia-${NVIDIA_VERSION}/libnvidia-ml.so /usr/lib/nvidia/libnvidia-ml.so && \
ln -s /usr/lib/nvidia-${NVIDIA_VERSION}/libnvidia-ml.so.1 /usr/lib/nvidia/libnvidia-ml.so.1 && \
apt-get -y install --no-install-recommends libcuinj64-10.1 && \
rm /tmp/cuda*.deb && \
apt-get -y autoclean && \
apt-get -y autoremove && \
apt-get clean
# Install the runtime components for nvidia
RUN \
rm -rf /var/lib/apt/lists/* && \
echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 /" > /etc/apt/sources.list.d/cuda.list && \
echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list && \
apt-get update
RUN apt-get install -y --no-install-recommends \
cuda-cudart-${CUDA_PACKAGE_VERSION} \
cuda-libraries-${CUDA_PACKAGE_VERSION} \
cuda-runtime-${CUDA_PACKAGE_VERSION}
# Might need something like sudo ln -s /usr/lib/x86_64-linux-gnu/libcublas.so.11.0 /usr/local/cuda-11.0/lib64/libcublas.so.11.0
RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/lib/nvidia
RUN apt-get install -y libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl \
libopenblas-base libopenblas-dev git build-essential
# Protobuf version
ENV PROTOBUF_VERSION="3.15.8"
ENV PROTOBUF_ZIP=protoc-${PROTOBUF_VERSION}-linux-x86_64.zip
ENV PROTOBUF_URL=https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/${PROTOBUF_ZIP}
RUN wget ${PROTOBUF_URL} && \
unzip ${PROTOBUF_ZIP} -d /usr && \
chmod +x /usr/bin/protoc && \
find /usr/include/google -type d -print0 | xargs -0 chmod ugo+rx && \
chmod -R +r /usr/include/google
LABEL vendor="Cognizant, Evolutionary AI, DB&T" \
registry.version=0.0.9 \
registry.repo=leafai/studio-go-runner-dev-base \
registry.base=studio-go-runner-dev-base