Skip to content

Commit e531ed1

Browse files
committed
merge develop divergence, add humble devcontainers
2 parents f5ef8b4 + 39c93a2 commit e531ed1

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

.devcontainer/humble/Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM ros:humble
2+
3+
# Add vscode user with same UID and GID as your host system
4+
# (modified from https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user#_creating-a-nonroot-user)
5+
# ubuntu now has a 1000 user ubuntu
6+
ARG USERNAME=ubuntu
7+
ARG USER_UID=1000
8+
ARG USER_GID=$USER_UID
9+
10+
RUN groupadd --gid $USER_GID $USERNAME \
11+
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
12+
13+
RUN apt-get update && apt-get upgrade -y \
14+
&& apt-get install -y \
15+
sudo \
16+
git \
17+
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
18+
&& chmod 0440 /etc/sudoers.d/$USERNAME
19+
20+
# Switch from root to user
21+
USER $USERNAME
22+
23+
# Rosdep update
24+
RUN rosdep update
25+
26+
# Source the ROS setup file
27+
RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc
28+
29+
# make sure folders exist
30+
RUN mkdir -p ~/colcon_ws/src
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "humble base",
3+
"dockerFile": "Dockerfile",
4+
"remoteUser": "ubuntu",
5+
"containerEnv": {
6+
"DISPLAY": "${localEnv:DISPLAY}"
7+
},
8+
"runArgs": [
9+
"--privileged",
10+
"--network=host"
11+
],
12+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/colcon_ws/src/${localWorkspaceFolderBasename},type=bind",
13+
"workspaceFolder": "/home/ubuntu/colcon_ws",
14+
"mounts": [
15+
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.bash_history,target=/home/ubuntu/.bash_history,type=bind"
16+
]
17+
}

0 commit comments

Comments
 (0)