-
Notifications
You must be signed in to change notification settings - Fork 60
/
Dockerfile-cmake
76 lines (64 loc) · 2.62 KB
/
Dockerfile-cmake
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
#
# Copyright (c) 2020-2021, NVIDIA CORPORATION.
# 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 nvidia/cuda:11.0-devel-ubuntu18.04
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
# Download and install Python3 PIP.
RUN apt-get update --yes \
&& apt-get upgrade --yes \
&& apt-get install --yes --fix-missing --no-install-recommends \
software-properties-common \
ca-certificates \
python3-minimal \
python3-pip \
&& add-apt-repository ppa:ubuntu-toolchain-r/test \
&& rm -rf /var/lib/apt/lists/*
RUN python3 --version
# Set additional environment values that make usage more pleasant.
ENV TERM=xterm-256color
# Make /usr/bin/python point to the ${VERSION_PYTHON3} version of python
RUN VERSION_PYTHON3=$(python3 --version | cut -c8-) && VERSION_PYTHON3=${VERSION_PYTHON3%.*} \
&& rm -f /usr/bin/python \
&& rm -f /usr/bin/python`echo ${VERSION_PYTHON3} | cut -c1-1` \
&& ln -s /usr/bin/python${VERSION_PYTHON3} /usr/bin/python \
&& ln -s /usr/bin/python${VERSION_PYTHON3} /usr/bin/python`echo ${VERSION_PYTHON3} | cut -c1-1`
# Make /usr/bin/pip point to the ${VERSION_PIP3} version of python
RUN rm -f /usr/bin/pip \
&& ln -s /usr/bin/pip3 /usr/bin/pip
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python3-dev \
gcc-9 \
g++-9 \
libopenslide-dev \
wget \
git \
curl \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/archives/partial/*
WORKDIR /workspace
ENV HOME=/workspace
# Use `python -m pip` to avoid using an old script wrapper.
RUN python -m pip install --no-cache-dir --upgrade pip setuptools wheel \
&& python -m pip install cmake
# Setup gcc-9
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 10 \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 20 \
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 10 \
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 20
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/nvvm/lib64
ENTRYPOINT ["/bin/bash"]