-
Notifications
You must be signed in to change notification settings - Fork 28
/
Dockerfile
75 lines (62 loc) · 1.79 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
FROM ros:noetic
### Arguments ###
ARG BUILD_DIR_NAME=docker-build
ARG DEBIAN_FRONTEND=noninteractive
ENV WORKDIR=/root/$BUILD_DIR_NAME
ENV LIBGL_ALWAYS_INDIRECT=1
ENV XDG_RUNTIME_DIR=/tmp/runtime-root
# Set the workdir
WORKDIR $WORKDIR
### Basic Setup ###
# Update and install tools
RUN apt-get update && apt-get install -y --no-install-recommends \
openssh-server \
xvfb \
bat \
vim \
neovim \
nano \
tmux \
screen \
curl \
wget \
usbutils apt-utils \
ros-noetic-cv-bridge \
ros-noetic-resource-retriever \
ros-noetic-actionlib-tools \
ros-noetic-robot-localization \
ros-noetic-image-transport-plugins \
python-dev-is-python3 \
python3-pip \
python3-catkin-tools python3-osrf-pycommon \
git \
gdb \
valgrind \
locales && \
apt-get clean && \
# Clear apt caches to reduce image size
rm -rf /var/lib/apt/lists/*
# Set up locales
RUN locale-gen en_GB.UTF-8 && locale-gen en_US.UTF-8
# Set a password for root
RUN echo root:robotics | chpasswd
# Allow root to login over ssh and forward graphics over ssh
# Allow for environment variables to be set in ssh
RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config && \
echo "X11UseLocalhost no" >> /etc/ssh/sshd_config && \
echo "PermitUserEnvironment yes" >> /etc/ssh/sshd_config && \
mkdir -p /root/.ssh && \
touch /root/.ssh/environment
COPY ssh_entry.sh /root/.bash_profile
COPY ros_bashrc.sh /root/ros_bashrc.sh
RUN echo "source /root/ros_bashrc.sh" >> /root/.bashrc
COPY tmux.conf /etc/
### Final Setup ###
# Install common pip packages
RUN pip3 install autopep8 psutil
# Add catkin ws
RUN mkdir -p /root/dev/robosub-ros
# Copy and set entrypoint script
COPY entrypoint.sh entrypoint.sh
RUN chmod +x entrypoint.sh
ENTRYPOINT $WORKDIR/entrypoint.sh