FROM nvcr.io/nvidia/tensorflow:19.12-tf1-py3 MAINTAINER Jin Li ENV PATH="/opt/aws_sagemaker/infrastructure:${PATH}" RUN mkdir -p /opt/aws_sagemaker/bin \ && mkdir -p /opt/ml/input/config \ && touch /opt/ml/input/config/hyperparameters.json \ && touch /opt/ml/input/config/resourceConfig.json \ && mkdir -p /opt/ml/input/data \ && mkdir -p /opt/ml/model \ && mkdir -p /opt/ml/output \ && apt-get -y update \ && apt-get install -y --no-install-recommends \ wget \ nginx \ ca-certificates \ libcurl4-openssl-dev \ zlib1g-dev \ git \ pkg-config \ python3 \ python3-pip \ python3-dev \ python3-setuptools \ python3-wheel \ sudo \ pbzip2 \ pv \ bzip2 RUN pip install --upgrade pip \ && pip install \ pycuda \ flask \ gevent \ gunicorn \ pycuda \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /root/.cache # Install Cmake RUN cd /tmp && \ wget https://github.com/Kitware/CMake/releases/download/v3.14.4/cmake-3.14.4-Linux-x86_64.sh && \ chmod +x cmake-3.14.4-Linux-x86_64.sh && \ ./cmake-3.14.4-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir --skip-license && \ rm ./cmake-3.14.4-Linux-x86_64.sh RUN git clone https://github.com/NVIDIA/TensorRT.git --recursive && cd TensorRT RUN cd TensorRT && git checkout 77af534c21b7e1bfa322ccbab028477be4c56eb3 && git submodule update --init --recursive && mkdir build && cd build && cmake .. -DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr --expt-extended-lambda -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75" && make -j nvinfer_plugin # Replace the default plugin library with the open-source plugins RUN cp TensorRT/build/libnvinfer_plugin.so* /usr/lib/x86_64-linux-gnu/ COPY infrastructure /opt/aws_sagemaker/infrastructure RUN chmod +x /opt/aws_sagemaker/infrastructure/entrypoint.sh WORKDIR "/opt/aws_sagemaker/infrastructure" ENTRYPOINT [ "entrypoint.sh" ]