-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile
128 lines (111 loc) · 3.29 KB
/
Dockerfile
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#####################
# Base image #
#####################
FROM nvidia/cuda:12.3.2-runtime-ubuntu20.04 as base
# Labels
LABEL maintainer="Matias Mattamala;Jonas Frey"
LABEL contact="[email protected];[email protected]"
LABEL description="WVN Docker"
ARG ROS_VERSION="noetic"
# ==
# Disable dialog frontend
# ==
ARG DEBIAN_FRONTEND=noninteractive
# ==
# Select shell
# ==
SHELL ["/bin/bash", "-c"]
# ==
# Install ROS
# ==
RUN apt update \
&& apt install --no-install-recommends -y curl gnupg lsb-release git build-essential nano \
&& sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' \
&& curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - \
&& apt update \
&& apt install --no-install-recommends -y ros-${ROS_VERSION}-desktop-full \
&& apt install --no-install-recommends -y \
python3-pip \
python3-venv \
python3-rosdep \
python3-rosinstall \
python3-rosinstall-generator \
python3-wstool \
python3-catkin-tools \
python3-osrf-pycommon \
&& rm -f "/etc/ros/rosdep/sources.list.d/20-default.list" \
&& rosdep init \
&& rosdep update \
&& echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
# ==
# Install python packages
# ==
RUN cd /root \
&& python3 -m venv env --system-site-packages \
&& source /root/env/bin/activate \
&& pip install --upgrade pip \
&& pip3 install --no-cache-dir \
torch==2.1.0 torchvision --extra-index-url https://download.pytorch.org/whl/cu121 \
&& pip3 install --no-cache-dir \
black \
flake8 \
jupyter \
wget \
numpy \
tqdm \
kornia \
torchmetrics \
pytorch_lightning \
pytest \
scipy \
scikit-image \
scikit-learn \
matplotlib \
seaborn \
pandas \
pytictac \
torch_geometric \
omegaconf \
optuna \
neptune \
fast-slic \
hydra-core \
prettytable \
termcolor \
pydensecrf@git+https://github.com/lucasb-eyer/pydensecrf.git \
liegroups@git+https://github.com/mmattamala/liegroups \
opencv-python
# ==
# Remove cache and extra files
# ==
RUN rm -rf /var/lib/apt/lists/* && apt clean
# ==
# Enable dialog again
# ==
ARG DEBIAN_FRONTEND=dialog
# ==
# Run bash
# ==
CMD ["/bin/bash"]
WORKDIR /root/catkin_ws
###############################################################
# Development image
# This adds display access and simulation support
###############################################################
FROM base as dev
ENV DEBIAN_FRONTEND=noninteractive
RUN mkdir -p /root/catkin_ws/src \
&& source /opt/ros/noetic/setup.bash \
&& source "/root/.bashrc" \
&& cd /root/catkin_ws && catkin build \
&& apt-get update \
&& apt-get install -y \
ros-noetic-jackal-simulator \
ros-noetic-jackal-desktop \
ros-noetic-teleop-twist-keyboard \
ros-noetic-rqt-robot-steering \
&& rm -rf /var/lib/apt/lists/*
RUN echo "source /root/catkin_ws/devel/setup.bash" >> ~/.bashrc
RUN echo "source /root/env/bin/activate" >> ~/.bashrc
COPY docker/first_run.sh first_run.sh
ENV DEBIAN_FRONTEND=dialog