-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathros2.dockerfile
More file actions
53 lines (41 loc) · 1.55 KB
/
ros2.dockerfile
File metadata and controls
53 lines (41 loc) · 1.55 KB
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
FROM osrf/ros:humble-desktop
# This makes apt run non-interactively, which prevents problems with packages
# stopping the system for keyboard input
ENV DEBIAN_FRONTEND noninteractive
LABEL maintainer="fillip.cannard@swri.org"
LABEL description="ROS2 Humble docker environment for students in the Shell APC to develop autonomous software to control a simulated vehicle in CARLA."
# Update dependencies
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
build-essential \
git \
pip \
python3-colcon-common-extensions \
python3-dev \
python3-pip \
python3-pybind11 \
&& rm -rf /var/lib/apt/lists/*
# Install CARLA dependencies and CARLA client library
RUN python3 -m pip install --upgrade pip && \
python3 -m pip install numpy pygame && \
python3 -m pip install 'carla==0.9.15'
# These arguments set up the name, group ID, and user ID of the user inside the container
ARG UNAME=carla
ARG UID=1000
ARG GID=1000
# Allow us to run sudo commands without a password
RUN echo "$UNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Add a normal user with the same name/uid/gid as the host user.
RUN groupadd -g $GID $UNAME
RUN useradd -l -m -u $UID -g $GID -s /bin/bash $UNAME
RUN chown $UID:$GID /home/$UNAME
# Switch to our sudo user
USER $UNAME
WORKDIR /home/$UNAME
SHELL ["/bin/bash", "-c"]
# Setup ROS automatic ROS sourcing
RUN echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> ~/.bashrc
# Reset ROS entrypoint
ENTRYPOINT []
CMD ["/bin/bash", "-c", "sleep infinity"]