forked from foxglove/foxglove-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.ros
More file actions
47 lines (42 loc) · 1.7 KB
/
Copy pathDockerfile.ros
File metadata and controls
47 lines (42 loc) · 1.7 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
ARG ROS_DISTRIBUTION=rolling
FROM ros:$ROS_DISTRIBUTION-ros-base
# Prevent errors from apt-get.
# See: http://askubuntu.com/questions/506158/unable-to-initialize-frontend-dialog-when-using-ssh
ENV DEBIAN_FRONTEND=noninteractive
# The ROS docker images are only updated when the underlying
# Ubuntu layer changes; this is a limitation of being an
# "official" docker image. Additionally, ROS packages do
# not have minimum dependency requirements. That is,
# ROS package "A" may have a dependency on "B", but it cannot
# easily specify what version of "B" that it needs.
# However, the latest versions of the ROS packages
# are always expected to work together.
#
# This means that we *always* have to do an
# "apt-get dist-upgrade" before we install dependencies
# with "make deps" below (which calls "rosdep install").
# That ensures that we have the latest versions of the
# ROS packages in the underlay and for what is installed
# by rosdep.
RUN apt-get update && apt-get -y dist-upgrade
# create foxglove user (or use existing user if UID matches)
ARG USERNAME=foxglove
ARG USER_UID=1005
ARG USER_GID=$USER_UID
RUN <<EOF
if ! getent passwd $USER_UID >/dev/null 2>&1; then
groupadd --gid $USER_GID $USERNAME
useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$USERNAME
else
EXISTING_USER=$(getent passwd $USER_UID | cut -d: -f1)
echo "User with UID $USER_UID already exists: $EXISTING_USER"
echo "$EXISTING_USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$EXISTING_USER
fi
EOF
USER $USER_UID
# rosdep update must run as user
RUN rosdep update --include-eol-distros
WORKDIR /sdk/ros
COPY --chown=$USER_UID:$USER_GID ./ros /sdk/ros
RUN make deps