initial commit
This commit is contained in:
46
docker/Dockerfile
Normal file
46
docker/Dockerfile
Normal file
@ -0,0 +1,46 @@
|
||||
FROM ubuntu:24.04
|
||||
|
||||
ENV PIP_BREAK_SYSTEM_PACKAGES=1 \
|
||||
SHELL=/bin/bash
|
||||
|
||||
ARG USERNAME=can_viewer
|
||||
ARG USER_UID=1000
|
||||
ARG USER_GID=${USER_UID}
|
||||
|
||||
RUN if id -u "${USER_UID}" >/dev/null 2>&1; then \
|
||||
userdel "$(id -un "${USER_UID}")"; \
|
||||
fi \
|
||||
&& groupadd --gid "${USER_GID}" "${USERNAME}" \
|
||||
&& useradd --uid "${USER_UID}" --gid "${USER_GID}" -m "${USERNAME}" \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends 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 \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
python3-pip \
|
||||
nano \
|
||||
python3-rosdep \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN pip3 install --no-cache-dir python-can cantools
|
||||
|
||||
RUN echo "source /opt/ros/jazzy/setup.bash" \
|
||||
>> /home/${USERNAME}/.bashrc \
|
||||
&& echo "source /workspaces/can_viewer/install/setup.bash" \
|
||||
>> /home/${USERNAME}/.bashrc
|
||||
|
||||
RUN usermod --shell /bin/bash -aG video ${USERNAME}
|
||||
|
||||
WORKDIR /workspaces/can_viewer
|
||||
COPY --chown=${USERNAME}:${USERNAME} ros2_ws/src ros2_ws/src
|
||||
|
||||
RUN rosdep update \
|
||||
&& rosdep install -r --rosdistro jazzy \
|
||||
--from-paths ros2_ws/src --ignore-src -y
|
||||
|
||||
USER ${USERNAME}
|
||||
|
||||
CMD ["/bin/bash"]
|
||||
Reference in New Issue
Block a user