Dockerfile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ARG FROM_IMAGE_NAME=nvcr.io/nvidia/tensorflow:21.02-tf2-py3
  15. FROM ${FROM_IMAGE_NAME}
  16. LABEL model="MaskRCNN"
  17. ENV DEBIAN_FRONTEND=noninteractive
  18. RUN apt-get update && \
  19. apt-get install -y libsm6 libxext6 libxrender-dev python3-tk cmake && \
  20. apt-get clean && \
  21. rm -rf /var/lib/apt/lists/*
  22. # install pybind11
  23. RUN pip --no-cache-dir --no-cache install Cython pytest && \
  24. git clone -b v2.5.0 https://github.com/pybind/pybind11 /opt/pybind11 && \
  25. cd /opt/pybind11 && cmake . && make install && pip install .
  26. # update protobuf 3 to 3.3.0
  27. RUN \
  28. curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip && \
  29. unzip -u protoc-3.3.0-linux-x86_64.zip -d protoc3 && \
  30. mv protoc3/bin/* /usr/local/bin/ && \
  31. mv protoc3/include/* /usr/local/include/
  32. # switch work directory
  33. ARG WORKSPACE=/workspace/mrcnn_tf2
  34. WORKDIR ${WORKSPACE}
  35. # install dependencies
  36. ADD requirements.txt .
  37. RUN pip install -r requirements.txt
  38. # copy code
  39. ADD . ${WORKSPACE}