-
Notifications
You must be signed in to change notification settings - Fork 28
Dockerfile and devcontainer.json #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 15 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
00cf5a4
init
nicholaspalomo 1cc9b63
may need to revert this
nicholaspalomo bb74ab1
almost finishes building
nicholaspalomo 439e962
colcon build with sequential executor
nicholaspalomo 798435a
builds
nicholaspalomo 04354f3
devcontainer works
nicholaspalomo 0cb7cd9
devcontainer and dockerfile
nicholaspalomo 38ab5e6
.
nicholaspalomo eda43e9
remove bash
nicholaspalomo 3fb2491
use pinocchio precompiled library
nicholaspalomo 8c3ff5a
configure X11 permissions
nicholaspalomo f879dc6
git permissions in dev container
de2e8b1
remove dead code
nicholaspalomo 106aa45
cleanup
9cda894
Merge branch 'manumerous:main' into dockerfile
nicholaspalomo 06d6fde
Update dockerfile to install from dependencies.txt
89fe21b
Merge pull request #1 from manumerous/update/dockerfile
nicholaspalomo 920b861
add missing dependencies
6bf7093
make ROS_DISTRO an arg
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"name": "Whole Body MPC Dev Container", | ||
"initializeCommand": "xhost +local:", | ||
"build": { | ||
"dockerfile": "${localWorkspaceFolder}/docker/Dockerfile", | ||
"target": "base", | ||
"args": { | ||
"WB_HUMANOID_MPC_DIR": "/wb_humanoid_mpc_ws", | ||
"PYTHON_VERSION": "3.12", | ||
"USER_ID": "${localEnv:USER_ID}", | ||
"GROUP_ID": "${localEnv:GROUP_ID}", | ||
"GIT_USER_NAME": "${command:git config --global user.name}", | ||
"GIT_USER_EMAIL": "${command:git config --global user.email}" | ||
} | ||
}, | ||
"runArgs": [ | ||
"--rm", | ||
"-it", | ||
"--net=host", | ||
"--privileged", | ||
"-u", "${localEnv:USER_ID}:${localEnv:GROUP_ID}", | ||
"-e", "DISPLAY", | ||
"-e", "QT_X11_NO_MITSHM=1", | ||
"-e", "XDG_RUNTIME_DIR=${localEnv:XDG_RUNTIME_DIR}", | ||
"-e", | ||
"GIT_USER_NAME=$(git config --global user.name)", | ||
"-e", | ||
"GIT_USER_EMAIL=$(git config --global user.email)", | ||
"-v", "/tmp/.X11-unix:/tmp/.X11-unix", | ||
"-v", "${localEnv:XDG_RUNTIME_DIR}:${localEnv:XDG_RUNTIME_DIR}" | ||
], | ||
"overrideCommand": true, | ||
"workspaceFolder": "/wb_humanoid_mpc_ws/src/wb_humanoid_mpc", | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"terminal.integrated.defaultProfile.linux": "bash", | ||
"editor.formatOnSave": true, | ||
"files.trimTrailingWhitespace": true | ||
}, | ||
"extensions": [ | ||
"ms-vscode.cpptools", | ||
"ms-vscode.cmake-tools", | ||
"ms-vscode-remote.remote-containers", | ||
"ms-azuretools.vscode-docker", | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"eamodio.gitlens", | ||
"GitHub.copilot", | ||
"GitHub.copilot-chat", | ||
"twxs.cmake", | ||
"cheshirekow.cmake-format", | ||
"xaver.clang-format", | ||
"ms-toolsai.jupyter-keymap", | ||
"ms-vscode-remote.remote-ssh", | ||
"ms-vscode-remote.remote-ssh-edit", | ||
"ms-vscode.remote-explorer", | ||
"sankethdev.vscode-proto" | ||
] | ||
} | ||
}, | ||
"mounts": [ | ||
"source=${localWorkspaceFolder}/../..,target=/wb_humanoid_mpc_ws,type=bind,consistency=cached", | ||
"source=${localEnv:HOME}/.gitconfig,target=/home/vscode/.gitconfig,type=bind" | ||
], | ||
"postCreateCommand": "git config --global user.name \"$GIT_USER_NAME\" && git config --global user.email \"$GIT_USER_EMAIL\" && git config --global --add safe.directory /wb_humanoid_mpc_ws/src/wb_humanoid_mpc && curl -o .git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash && echo 'source /opt/ros/jazzy/setup.bash' >> ~/.bashrc && echo 'source ./.git-completion.bash' >> ~/.bashrc" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
ARG BASE_IMAGE=ubuntu:24.04 | ||
FROM ${BASE_IMAGE} AS base | ||
|
||
ARG USER_ID=1000 | ||
ARG GROUP_ID=1000 | ||
ARG WB_HUMANOID_MPC_DIR="/wb_humanoid_mpc_ws" | ||
ARG PYTHON_VERSION=3.12 | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV ROS_DISTRO=jazzy | ||
|
||
# Install system dependencies, ROS, Python, and development tools in a single step | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
curl gnupg2 lsb-release locales software-properties-common \ | ||
git build-essential clang-format make ninja-build \ | ||
python3-pygame libeigen3-dev libglpk-dev libboost-all-dev \ | ||
libboost-filesystem-dev libboost-log-dev libglfw3-dev \ | ||
x11-apps mesa-utils \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Set up locales | ||
RUN locale-gen en_US.UTF-8 && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 LANGUAGE en_US:en LC_ALL en_US.UTF-8 | ||
|
||
# Install Python and pip | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-tk libpython${PYTHON_VERSION}-dev \ | ||
python3-pip python3-argcomplete \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
RUN ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python3 | ||
RUN python3 -m pip install --break-system-packages --no-cache-dir --upgrade setuptools cython catkin_pkg colcon-common-extensions | ||
|
||
# Add ROS2 repository and install core packages | ||
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - && \ | ||
echo "deb http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
ros-${ROS_DISTRO}-desktop ros-${ROS_DISTRO}-ament-cmake \ | ||
ros-${ROS_DISTRO}-ament-cmake-clang-format \ | ||
ros-${ROS_DISTRO}-joint-state-publisher-gui ros-${ROS_DISTRO}-xacro \ | ||
ros-${ROS_DISTRO}-mcap-vendor ros-${ROS_DISTRO}-interactive-markers \ | ||
ros-${ROS_DISTRO}-std-msgs ros-${ROS_DISTRO}-pinocchio \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Increase Git buffer size | ||
RUN git config --global http.postBuffer 1048576000 | ||
|
||
# Set default shell to bash | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
# Set up environment variables | ||
ENV CMAKE_PREFIX_PATH="/opt/ros/${ROS_DISTRO}:${CMAKE_PREFIX_PATH}" | ||
ENV DISPLAY=${DISPLAY} QT_X11_NO_MITSHM=1 | ||
|
||
# Set up user and workspace | ||
WORKDIR ${WB_HUMANOID_MPC_DIR} | ||
RUN mkdir -p ${WB_HUMANOID_MPC_DIR}/src/wb_humanoid_mpc | ||
|
||
# Ensure correct UID/GID | ||
RUN if ! getent group $GROUP_ID > /dev/null; then groupadd --gid $GROUP_ID devgroup; fi && \ | ||
if ! getent passwd $USER_ID > /dev/null; then useradd --uid $USER_ID --gid $GROUP_ID --create-home devuser; fi && \ | ||
chown -R $USER_ID:$GROUP_ID . | ||
|
||
# Copy the Makefile and other necessary files | ||
COPY . ${WB_HUMANOID_MPC_DIR}/src/wb_humanoid_mpc |
Submodule pinocchio
deleted from
16d84f
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.