Skip to content

Commit e0553d2

Browse files
authored
Update Dockerfile
1 parent 12f4707 commit e0553d2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.devcontainer/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,17 @@ WORKDIR /deep_ros_ws
7979
# ===============================================
8080
# Add User Configuration
8181
# ===============================================
82-
FROM dev-tools AS user-conf
82+
FROM dev-tools as user-conf
8383
ARG USERNAME
84+
ARG USER_GID
85+
ARG USER_UID
8486
ARG ROS_DISTRO
8587

8688
# Cater image to user
8789
SHELL ["/bin/bash", "-c"]
88-
COPY .env /tmp/.env
8990
# hadolint ignore=SC2086
90-
RUN source /tmp/.env && rm /tmp/.env \
91-
&& groupadd --gid $USER_GID $USERNAME \
92-
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME --shell /bin/bash \
91+
RUN groupadd --gid ${USER_GID} ${USERNAME} \
92+
&& useradd --uid ${USER_UID} --gid ${USER_GID} -m $USERNAME --shell /bin/bash \
9393
&& apt-get update \
9494
&& apt-get install -y --no-install-recommends sudo \
9595
&& echo $USERNAME ALL=\(ALL\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
@@ -104,3 +104,4 @@ USER $USERNAME
104104

105105
# Source ROS in user's bashrc
106106
RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/$USERNAME/.bashrc
107+

0 commit comments

Comments
 (0)