Dockerfile 2.04 KB
Newer Older
zhenyi's avatar
zhenyi committed
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
#===============================================================================
#
# Copyright (c) 2020, NVIDIA CORPORATION. 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.
#
# ==============================================================================

ARG FROM_IMAGE_NAME=nvcr.io/nvidia/tensorflow:20.06-tf1-py3
FROM ${FROM_IMAGE_NAME}

ENV DEBIAN_FRONTEND=noninteractive

RUN rm -rf /workspace && mkdir -p /workspace
ADD . /workspace
WORKDIR /workspace

RUN apt-get update && \
    apt-get install -y libsm6 libxext6 libxrender-dev python3-tk cmake && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Make sure python and pip points to pip3 and python3
RUN python -m pip install --upgrade pip && \
    pip --no-cache-dir --no-cache install \
        Cython \
        matplotlib \
        opencv-python-headless \
        mpi4py \
        Pillow \
        pytest \
        pyyaml && \
    git clone https://github.com/pybind/pybind11 /opt/pybind11 && \
    cd /opt/pybind11 && cmake . && make install && pip install . && \
    pip --no-cache-dir --no-cache install \
        'git+https://github.com/NVIDIA/cocoapi#egg=pycocotools&subdirectory=PythonAPI' && \
    pip --no-cache-dir --no-cache install \
        'git+https://github.com/NVIDIA/dllogger'


# Update protobuf 3 to 3.3.0
RUN \
    curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip && \
    unzip -u protoc-3.3.0-linux-x86_64.zip -d protoc3 && \
    mv protoc3/bin/* /usr/local/bin/ && \
    mv protoc3/include/* /usr/local/include/