-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile.humble.nvidia
78 lines (70 loc) · 2.94 KB
/
Dockerfile.humble.nvidia
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
# This image allows you to have a Ubuntu 22.04 (Jammy) + ROS2 Humble
# setup. You can mount the path to the 'robotdev' repository in your
# host machine to the same path in the container. We ask you to use
# the same username in the container as in your host machine. This
# simplifies the maintenance of the 'robotdev' repository. This setup
# relies on the nice ros:noetic image provided on Docker Hub.
#
# Note that for this to work, you need to install nvidia-container-runtime
#
# Example: source build.humble.sh --nvidia --tag-suffix=nvidia
#
# /author: Kaiyu Zheng
FROM nvidia/cuda:12.2.0-devel-ubuntu22.04
RUN apt-get clean
RUN apt-get update
RUN apt-get install curl -y
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
ENV UBUNTU_RELEASE=jammy
RUN sh -c 'echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_RELEASE) main" > /etc/apt/sources.list.d/ros2.list'
# do this to avoid hanging
ENV DEBIAN_FRONTEND=noninteractive
# Install software
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN apt-get install -y --no-install-recommends apt-utils
RUN add-apt-repository -y ppa:kisak/kisak-mesa
RUN apt-get upgrade -y
RUN apt-get install -y ros-humble-desktop-full
RUN apt-get install -y emacs
RUN apt-get install -y sudo
RUN apt-get install -y python3-pip
RUN apt-get install -y net-tools
RUN apt-get install -y iputils-ping
RUN apt-get install -y git
RUN apt-get install -y python3-virtualenv
RUN apt-get install -y gdb
RUN apt-get install -y mlocate
RUN apt-get install -y libogre1.12.1
RUN apt-get install -y python3.10-venv
RUN apt-get install -y openssh-client openssh-server
RUN apt-get install -y ros-humble-rviz2
RUN apt-get install -y ros-humble-rviz-imu-plugin
RUN apt-get install -y ros-humble-interactive-marker-twist-server
RUN apt-get install -y ros-humble-joy
RUN apt-get install -y ros-humble-twist-mux
RUN apt-get install -y ros-humble-teleop-twist-joy
RUN apt-get install -y ros-humble-depthimage-to-laserscan
# create a user
ARG hostuser
ARG hostgroup
ARG hostuid
ARG hostgid
RUN echo Host user is $hostuser:$hostuser
RUN groupadd --gid $hostgid $hostgroup
RUN adduser --disabled-password --gecos '' --gid $hostgid --uid $hostuid $hostuser
RUN adduser $hostuser sudo
# Ensure sudo group users are not asked for a p3assword when using sudo command
# by ammending sudoers file
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> \
/etc/sudoers
USER $hostuser
WORKDIR /home/$hostuser
ENV HOME=/home/$hostuser
RUN mkdir $HOME/repo
# Different shell color
RUN echo "export PS1='\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;33m\]\w\[\033[00m\]$ '" >> $HOME/.bashrc
# print some info on start
RUN echo "echo -e 'Welcome! You are now in a docker container ().'" >> $HOME/.bashrc
RUN echo "echo -e \"Docker ID: $(basename $(cat /proc/1/cpuset))\"" >> $HOME/.bashrc
CMD ["bash"]