Skip to content

Commit 7f7804f

Browse files
committed
issues with setting user inside the container
1 parent af4b5d7 commit 7f7804f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.devcontainer/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ WORKDIR /deep_ros_ws
7171
# ===============================================
7272
FROM dev-tools as user-conf
7373
ARG USERNAME
74+
ARG USER_GID
75+
ARG USER_UID
7476
ARG ROS_DISTRO
7577

7678
# Cater image to user
7779
SHELL ["/bin/bash", "-c"]
78-
COPY .env /tmp/.env
7980
# hadolint ignore=SC2086
80-
RUN source /tmp/.env && rm /tmp/.env \
81-
&& groupadd --gid $USER_GID $USERNAME \
82-
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME --shell /bin/bash \
81+
RUN groupadd --gid ${USER_GID} ${USERNAME} \
82+
&& useradd --uid ${USER_UID} --gid ${USER_GID} -m $USERNAME --shell /bin/bash \
8383
&& apt-get update \
8484
&& apt-get install -y --no-install-recommends sudo \
8585
&& echo $USERNAME ALL=\(ALL\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \

0 commit comments

Comments
 (0)