diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d2180038..b6cac37f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,9 +9,11 @@ "ms-azuretools.vscode-docker", "ms-python.python", "ms-vscode.cpptools", + "ms-vscode.cpptools-extension-pack", "ms-iot.vscode-ros" ] } }, - "remoteUser": "dev" + "remoteUser": "dev", + "postCreateCommand": "echo 'source /opt/ros/noetic/setup.bash' >> ~/.bashrc" } diff --git a/devenv/Dockerfile b/devenv/Dockerfile index c2fd1b87..f60da3e0 100644 --- a/devenv/Dockerfile +++ b/devenv/Dockerfile @@ -9,8 +9,10 @@ RUN groupadd -g ${MY_GID} -o ${MY_USER} # Create a new user, assign it to the group, and set its shell to bash RUN useradd -m -u ${MY_UID} -g ${MY_GID} -o -s /bin/bash ${MY_USER} && yes ${MY_USER} | passwd ${MY_USER} +RUN echo $MY_USER ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$MY_USER \ + && chmod 0440 /etc/sudoers.d/$MY_USER + RUN apt-get update && apt-get install -y zsh git sudo ssh gdb rsync -RUN echo "$MY_USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers RUN ( \ echo 'LogLevel DEBUG2'; \ @@ -22,6 +24,8 @@ RUN ( \ && mkdir /run/sshd RUN bash -c "ssh-keygen -A" +RUN echo "$MY_USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers + # Update rosdep package manager for ROS RUN rosdep update --rosdistro $ROS_DISTRO