-
Notifications
You must be signed in to change notification settings - Fork 95
/
Dockerfile-cuda
36 lines (28 loc) · 1.38 KB
/
Dockerfile-cuda
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
FROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04
ARG branch=master
ARG ros_distro=noetic
# Fix NVIDIA CUDA Linux repository key rotation
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu$(cat /etc/os-release | grep VERSION_ID | awk '{print substr($0,13,5)}' | awk -F'.' '{print $1$2}')/x86_64/3bf863cc.pub
# Install dependencies
RUN apt-get update && \
apt-get --yes install git sudo apt-utils && \
DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata
# Add Tini
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
RUN sudo apt-get --yes install build-essential
# Clone the repo and install the toolkit
ENV OPENDR_DEVICE=gpu
ENV ROS_DISTRO=$ros_distro
RUN git clone --depth 1 --recurse-submodules -j8 https://github.com/opendr-eu/opendr -b $branch
WORKDIR "/opendr"
RUN chmod +x ./bin/install.sh && ./bin/install.sh && rm -rf /root/.cache/* && apt-get clean
# Create script for starting Jupyter Notebook
RUN /bin/bash -c "source ./bin/activate.sh; pip3 install jupyter" && \
echo "#!/bin/bash\n source ./bin/activate.sh\n ./venv/bin/jupyter notebook --port=8888 --no-browser --ip 0.0.0.0 --allow-root" > start.sh && \
chmod +x start.sh
# Start Jupyter Notebook inside OpenDR
CMD ["./start.sh"]