Skip to content

Instantly share code, notes, and snippets.

@ganindu7
Last active December 7, 2021 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ganindu7/863332b0401512ffb85e733feda5ee7c to your computer and use it in GitHub Desktop.
Save ganindu7/863332b0401512ffb85e733feda5ee7c to your computer and use it in GitHub Desktop.
version: '3.5'
services:
inference:
build:
context: .
dockerfile: Dockerfile
image: test_pytorch_deepstream:0.1
stdin_open: true # docker run -i
container_name: docker-test
hostname: docker.dgx
environment:
- DISPLAY=${DISPLAY}
- ROOTDIT=RDR
volumes:
- type: bind
source: /tmp/.X11-unix
target: /tmp/.X11-unix
- type: bind
source: $HOME/.Xauthority
target: /root/.Xauthority
network_mode: "host"
# Note: try with base
FROM nvcr.io/nvidia/deepstream:6.0-devel
WORKDIR /
ARG buildno
ARG gitcommithash
RUN echo " build number: ${buildno} "
RUN echo "based on commit: ${gitcommithash}"
ENV SHELL /bin/bash --login c
ENV PYENV_ROOT "$HOME/.pyenv"
ENV PYTHON_CONFIGURE_OPTS="--enable-shared"
ENV NVIDIA_VISIBLE_DEVICES \
${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES \
${NVIDIA_DRIVER_CAPABILITIES:-all}
ENV PORT 80
SHELL ["/bin/bash", "--login", "-c"]
RUN apt-get update && \
apt-get install -y software-properties-common && \
apt-get install -y --no-install-recommends --no-upgrade \
net-tools
RUN git clone https://github.com/pyenv/pyenv.git ~/.pyenv && \
cd ~/.pyenv && src/configure && make -C src && \
sed -Ei -e '/^([^#]|$)/ {a\
export PYENV_ROOT="$HOME/.pyenv"\n\export PATH="$PYENV_ROOT/bin:$PATH" \
' -e ':a' -e '$!{n;ba};}' ~/.profile && \
echo 'eval "$(pyenv init --path)"' >>~/.profile && \
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
SHELL ["/bin/bash", "--login", "-c"]
RUN cd ~/ && \
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv && \
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
# RUN pyenv install --verbose 3.6.15 && \
RUN pyenv install 3.6.15 && \
pyenv virtualenv 3.6.15 AIPY36
SHELL ["/bin/bash", "--login", "-c"]
#RUN git clone --depth 1 --branch 1.0 https://github.com/NVIDIA-AI-IOT/deepstream_python_apps.git
RUN git clone https://github.com/NVIDIA-AI-IOT/deepstream_python_apps.git /opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps && \
cd /opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps && \
pyenv local AIPY36 && source ~/.profile && \
echo "******* SET LOCAL PYTHON VERSION *******" && \
pyenv local
WORKDIR /home/nvidia
SHELL ["/bin/bash", "--login", "-c"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment