Commit b38a0f7 1 parent 46dc8b2 commit b38a0f7 Copy full SHA for b38a0f7
File tree 3 files changed +32
-38
lines changed
3 files changed +32
-38
lines changed Original file line number Diff line number Diff line change @@ -99,9 +99,9 @@ RUN --mount=type=ssh \
99
99
WORKDIR /workspace
100
100
101
101
# Create entrypoint
102
- COPY docker/autoware-openadk/etc/dev_entrypoint .sh /dev_entrypoint .sh
103
- RUN chmod +x /dev_entrypoint .sh
104
- ENTRYPOINT ["/dev_entrypoint .sh" ]
102
+ COPY docker/autoware-openadk/etc/ros_entrypoint .sh /ros_entrypoint .sh
103
+ RUN chmod +x /ros_entrypoint .sh
104
+ ENTRYPOINT ["/ros_entrypoint .sh" ]
105
105
CMD ["/bin/bash" ]
106
106
107
107
FROM base as runtime
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
# shellcheck disable=SC1090,SC1091
3
- set -e
4
3
5
- # hadolint ignore=SC1090
6
- source " /opt/ros/$ROS_DISTRO /setup.bash"
7
- source /autoware/install/setup.bash
8
- exec " $@ "
4
+ # Get the user ID and group ID of the local user
5
+ USER_ID=${LOCAL_UID}
6
+ USER_NAME=${LOCAL_USER}
7
+ GROUP_ID=${LOCAL_GID}
8
+ GROUP_NAME=${LOCAL_GROUP}
9
+
10
+ # Check if any of the variables are empty
11
+ if [[ -z $USER_ID || -z $USER_NAME || -z $GROUP_ID || -z $GROUP_NAME ]]; then
12
+ source " /opt/ros/$ROS_DISTRO /setup.bash"
13
+ source /autoware/install/setup.bash
14
+ exec " $@ "
15
+ else
16
+ echo " Starting with user: $USER_NAME >> UID $USER_ID , GID: $GROUP_ID "
17
+
18
+ # Create group and user with GID/UID
19
+ groupadd -g " $GROUP_ID " " $GROUP_NAME "
20
+ useradd -u " $USER_ID " -g " $GROUP_ID " -s /bin/bash -m -d /home/" $USER_NAME " " $USER_NAME "
21
+
22
+ # Add sudo privileges to the user
23
+ echo " $USER_NAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
24
+
25
+ # Source ROS2
26
+ # hadolint ignore=SC1090
27
+ source " /opt/ros/$ROS_DISTRO /setup.bash"
28
+ source /autoware/install/setup.bash
29
+
30
+ # Execute the command as the user
31
+ exec /usr/sbin/gosu " $USER_NAME " " $@ "
32
+ fi
You can’t perform that action at this time.
0 commit comments