Luego el tema es instalar cargo, y cualquier cosa de usuario final, con el user hecho antes, por ejemplo, para usar uv yo tengo en Dockerfile:
# Install uv
ARG VENV_NAME=vpy3.12
USER $CONTAINER_USER
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/home/${CONTAINER_USER}/.cargo/bin:$PATH"
# Create a system venv to use from now on
RUN uv venv /home/${CONTAINER_USER}/$VENV_NAME -p 3.12
# Use the virtual environment automatically
ENV VIRTUAL_ENV=/home/${CONTAINER_USER}/$VENV_NAME
# Place entry points in the environment at the front of the path
ENV PATH="/home/${CONTAINER_USER}/$VENV_NAME/bin:$PATH"
RUN uv python install 3.12
# Tooling + necessary to run rospy
RUN uv pip install ipython rospkg empy
Necesitarias anyadir algo como:
No es necesario pero yo suelo pasar a usar bash en el Docker/Dockerfile:
En el devcontainer.json:
No es necesario pero yo suelo forzar:
Luego el tema es instalar cargo, y cualquier cosa de usuario final, con el user hecho antes, por ejemplo, para usar
uv
yo tengo en Dockerfile: