Skip to content
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

Dockerfile #26

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "specless Docker container",
"dockerComposeFile": "docker-compose.yml",
"service": "specless",
"workspaceFolder": "/home/specless",
"privileged": true,
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"esbenp.prettier-vscode",
"redhat.vscode-yaml",
"aaron-bond.better-comments",
"shardulm94.trailing-spaces",
"ms-python.black-formatter",
"ms-toolsai.jupyter"
],
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true
}
],
"settings": {
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"python.formatting.provider": "black",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"python.formatting.blackArgs": [
"--line-length",
"88",
"--skip-magic-trailing-comma"
]
},
"nb_black.black_on_save": true,
"isort.args": [
"--profile",
"black"
]
}
}
}
}
11 changes: 11 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.8'

services:
specless:
build:
context: ../
dockerfile: Dockerfile
volumes:
- ../:/home/specless
stdin_open: true
tty: true
41 changes: 20 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
FROM hardikparwana/cuda12-ubuntu22:cuda122-cudnn8-jax
ARG PYTHON_VERSION=3.11
FROM python:${PYTHON_VERSION}

# ROS2 installation
RUN apt update && apt install -y locales
RUN locale-gen en_US en_US.UTF-8
RUN update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
RUN LANG=en_US.UTF-8
RUN apt-get install -y software-properties-common
RUN add-apt-repository universe
RUN apt update && apt install curl -y
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null
RUN apt update
ARG DEBIAN_FRONTEND=noninteractive
RUN apt install -y ros-humble-desktop
RUN apt install -y ros-dev-tools
RUN echo 'source /opt/ros/humble/setup.bash' >> ~/.bashrc
# https://python-poetry.org/docs#ci-recommendations
ENV POETRY_VERSION=1.7.0
# ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv

RUN apt-get install -y ros-humble-navigation2 ros-humble-nav2-bringup ros-humble-turtlebot3*
RUN apt-get install -y ros-humble-nav2-simple-commander
# Tell Poetry where to place its cache and virtual environment
ENV POETRY_CACHE_DIR=/opt/.cache

RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
RUN echo "source /usr/share/gazebo/setup.sh" >> ~/.bashrc
RUN echo "source /home/mobile_arm/colcon_ws/install/local_setup.bash" >> ~/.bashrc
# Creating a virtual environment just for poetry and install it with pip
RUN python3 -m venv $POETRY_VENV \
&& $POETRY_VENV/bin/pip install -U pip setuptools \
&& $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION}


# Add Poetry to PATH
ENV PATH="${PATH}:${POETRY_VENV}/bin"

ENV POETRY_VIRTUALENVS_IN_PROJECT=true

CMD ["bash"]
Loading
Loading