Skip to content
Snippets Groups Projects
Commit 689041f4 authored by Montaño Sarria, Andres Felipe's avatar Montaño Sarria, Andres Felipe
Browse files

WIP save working configs

parent f165a664
No related branches found
No related tags found
No related merge requests found
ARG ROS_DISTRO
ARG IMAGE_BASE
FROM ${IMAGE_BASE}:${ROS_DISTRO}
ARG USERNAME=USERNAME
ARG USER_UID=1000
ARG USER_GID=$USER_UID
# Delete user if it exists in container (e.g Ubuntu Noble: ubuntu)
RUN if id -u $USER_UID ; then userdel `id -un $USER_UID` ; fi
# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
#
# [Optional] Add sudo support. Omit if you don't need to install software after connecting.
&& apt-get update \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y python3-pip
# Set the shell by dafault
ARG SHELL=/bin/zsh
ENV SHELL ${SHELL}
ENV USER $USERNAME
# [Optional] Set the default user. Omit if you want to keep the default as root.
USER $USERNAME
# [Optional] Clone dotfiles and apply configuration
RUN git clone https://github.com/andsens/homeshick.git /home/$USERNAME/.homesick/repos/homeshick \
&& /home/$USERNAME/.homesick/repos/homeshick/bin/homeshick clone anfemosa/dotfiles \
&& /home/$USERNAME/.homesick/repos/homeshick/bin/homeshick link dotfiles
# ********************************************************
# * Anything else you want to do like clean up goes here *
# ********************************************************
CMD ["/bin/zsh"]
\ No newline at end of file
{
"name": "ROS2 Development",
"privileged": true,
"remoteUser": "${env:USERNAME}",
// Name of the dockerfile used to generate the image, alternatively a given image could be use by "image" parameter, e.g. "image":"devenv:humble"
"build": {
"dockerfile": "Dockerfile",
"args": {
"IMAGE_BASE": "${env:IMAGE_BASE}",
"ROS_DISTRO": "${env:ROS_DISTRO}",
"SHELL": "${env:SHELL}",
"USERNAME": "${env:USERNAME}"
}
},
"runArgs": [
"--cap-add=SYS_PTRACE", // Allows the container to trace processes using ptrace system call
"--security-opt=seccomp=unconfined", // Disables seccomp security profiles for the container
"--net=host",
"--pid=host",
"--ipc=host",
"--rm", // Remove the container when stop it.
"--name=${localEnv:ROS_DISTRO}"
],
// Mount the workspace
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind",
"workspaceFolder": "${localWorkspaceFolder}",
// Uncomment to allow the container to access the X server on the host e.g. to run Rviz and other GUI tools
"containerEnv": {
"DISPLAY": "${localEnv:DISPLAY}"
},
"mounts": [
///*
// Uncomment to allow the container to access the X server on the host e.g. to run Rviz and other GUI tools
{
"source": "/tmp/.X11-unix",
"target": "/tmp/.X11-unix",
"type": "bind"
},
{
"source": "${localEnv:XAUTHORITY:-$HOME/.Xauthority}",
"target": "${localEnv:HOME}/.Xauthority",
"type": "bind"
},
// Mount the host's /dev directory allowing the container to access hardware/devices on the host
{
"source": "/dev",
"target": "/dev",
"type": "bind"
}
// [Optional] Mount bash history
,
{
"source": "${localEnv:HOME}/.bash_eternal_history",
"target": "${localEnv:HOME}/.bash_eternal_history",
"type": "bind"
}
//*/
],
//"postCreateCommand": "sudo rosdep update && sudo rosdep install --from-paths src --ignore-src -y",
"postCreateCommand": "direnv allow .",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "${localEnv:SHELL}"
},
"extensions": [
// "aaron-bond.better-comments",
// "cheshirekow.cmake-format",
"codeium.codeium",
// "codezombiech.gitignore",
"eamodio.gitlens",
"github.github-vscode-theme",
// "hbenl.vscode-test-explorer",
// "jeff-hykin.better-cpp-syntax",
// "josetr.cmake-language-support-vscode",
// "kaih2o.python-resource-monitor",
// "kevinrose.vsc-python-indent",
// "llvm-vs-code-extensions.vscode-clangd",
// "mhutchie.git-graph",
// "mintlify.document",
// "ms-azuretools.vscode-docker",
// "ms-dotnettools.vscode-dotnet-runtime",
"ms-iot.vscode-ros",
// "ms-python.autopep8",
// "ms-python.black-formatter",
// "ms-python.debugpy",
// "ms-python.flake8",
// "ms-python.isort",
// "ms-python.python",
// "ms-python.vscode-pylance",
// "ms-vscode-remote.remote-containers",
// "ms-vscode-remote.remote-ssh-edit",
// "ms-vscode-remote.remote-ssh",
// "ms-vscode-remote.remote-wsl",
// "ms-vscode-remote.vscode-remote-extensionpack",
// "ms-vscode.cmake-tools",
// "ms-vscode.cpptools-extension-pack",
// "ms-vscode.cpptools-themes",
// "ms-vscode.cpptools",
// "ms-vscode.remote-explorer",
// "ms-vscode.remote-server",
// "ms-vscode.test-adapter-converter",
// "njpwerner.autodocstring",
// "njqdev.vscode-python-typehint",
"oderwat.indent-rainbow",
"theumletteam.umlet",
"twxs.cmake",
// "visualstudioexptteam.intellicode-api-usage-examples",
// "visualstudioexptteam.vscodeintellicode",
"vscode-icons-team.vscode-icons",
// "ziyasal.vscode-open-in-github"
]
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment