Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/_build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
file: ./${{ inputs.dockerfile }}
platforms: ${{ inputs.architectures }}
push: true
cache-from: type=registry,ref=lcas.lincoln.ac.uk/cache/${{ inputs.push_image }}:${{ inputs.ros_distro }}
# cache-from: type=registry,ref=lcas.lincoln.ac.uk/cache/${{ inputs.push_image }}:${{ inputs.ros_distro }}
cache-to: type=registry,ref=lcas.lincoln.ac.uk/cache/${{ inputs.push_image }}:${{ inputs.ros_distro }},mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
37 changes: 27 additions & 10 deletions base.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,27 @@ ENV ROS_DISTRO=${ROS_DISTRO}

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get upgrade -y && apt-get install -y \
RUN apt-get update || true \
&& apt-get install -y --no-install-recommends gnupg ca-certificates \
&& apt-get update \
&& apt-get upgrade -y \
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cmake \
git \
curl \
wget \
unzip \
ros-${ROS_DISTRO}-ros-base \
python3-colcon-common-extensions \
ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \
python3-colcon-common-extensions && \
rm -rf /var/lib/apt/lists/* \
&& locale-gen en_GB.UTF-8 \
&& update-locale LC_ALL=en_GB.UTF-8 LANG=en_GB.UTF-8 \
&& rm -rf /var/lib/apt/lists/*


RUN . /opt/ros/${ROS_DISTRO}/setup.sh && rosdep update

ARG USERNAME=ros
Expand All @@ -29,20 +39,27 @@ ARG USER_GID=$USER_UID

# Create a non-root user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
# Add sudo support for the non-root user
&& 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 \
&& rm -rf /var/lib/apt/lists/*
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
# Add sudo support for the non-root user
&& 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 \
&& rm -rf /var/lib/apt/lists/*

# Cyclone DDS Config
COPY cyclonedds.xml /etc/cyclonedds.xml

# Configure bash profile
RUN echo "if [ -f /etc/bash.bashrc ]; then source /etc/bash.bashrc; fi" >> /root/.bashrc && \
echo "if [ -f /etc/bash.bashrc ]; then source /etc/bash.bashrc; fi" >> /home/${USERNAME}/.bashrc && \
echo 'PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ "' >> /etc/bash.bashrc && \
echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /etc/bash.bashrc && \
echo "alias t='tmux'" >> /etc/bash.bashrc && \
echo "alias cls='clear'" >> /etc/bash.bashrc
echo "alias cls='clear'" >> /etc/bash.bashrc && \
echo "RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" >> /etc/bash.bashrc && \
echo "CYCLONEDDS_URI=file:///etc/cyclonedds.xml" >> /etc/bash.bashrc

USER ${USERNAME}
CMD ["bash", "-l"]

28 changes: 19 additions & 9 deletions cuda.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,27 @@ ENV ROS_DISTRO=${ROS_DISTRO}

ENV DEBIAN_FRONTEND=noninteractive

# Install language
RUN apt-get update ; \
apt-get upgrade -y && \
RUN apt-get update || true \
&& apt-get install -y --no-install-recommends gnupg ca-certificates \
&& apt-get update \
&& apt-get upgrade -y \
apt-get install -y --no-install-recommends \
locales \
curl \
wget \
ca-certificates \
gnupg2 \
lsb-release \
git \
nano \
python3-setuptools \
software-properties-common \
wget \
tzdata \
&& locale-gen en_US.UTF-8 \
&& update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 \
&& locale-gen en_GB.UTF-8 \
&& update-locale LC_ALL=en_GB.UTF-8 LANG=en_GB.UTF-8 \
&& rm -rf /var/lib/apt/lists/*
ENV LANG=en_US.UTF-8

RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
ENV LANG=en_GB.UTF-8

# Prepare ROS2
RUN add-apt-repository universe \
Expand All @@ -40,8 +41,12 @@ RUN add-apt-repository universe \
RUN apt-get update && apt-get install -y --no-install-recommends \
ros-${ROS_DISTRO}-ros-base \
python3-rosdep \
ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \
&& rm -rf /var/lib/apt/lists/*

# Cyclone DDS Config
COPY cyclonedds.xml /etc/cyclonedds.xml

RUN . /opt/ros/${ROS_DISTRO}/setup.sh && rosdep init && rosdep update

# Setup VirtualGL
Expand All @@ -65,10 +70,13 @@ RUN groupadd --gid $USER_GID $USERNAME \

# Configure bash profile
RUN echo "if [ -f /etc/bash.bashrc ]; then source /etc/bash.bashrc; fi" >> /root/.bashrc && \
echo "if [ -f /etc/bash.bashrc ]; then source /etc/bash.bashrc; fi" >> /home/${USERNAME}/.bashrc && \
echo 'PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ "' >> /etc/bash.bashrc && \
echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /etc/bash.bashrc && \
echo "alias t='tmux'" >> /etc/bash.bashrc && \
echo "alias cls='clear'" >> /etc/bash.bashrc
echo "alias cls='clear'" >> /etc/bash.bashrc && \
echo "RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" >> /etc/bash.bashrc && \
echo "CYCLONEDDS_URI=file:///etc/cyclonedds.xml" >> /etc/bash.bashrc

ENV TVNC_VGL=1
ENV VGL_ISACTIVE=1
Expand All @@ -80,5 +88,7 @@ ENV VGL_PROBEGLX=0
ENV LD_PRELOAD=/usr/lib/libdlfaker.so:/usr/lib/libvglfaker.so
ENV SHELL=/bin/bash

USER ${USERNAME}

CMD ["bash", "-l"]

10 changes: 10 additions & 0 deletions docker/cyclonedds.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<CycloneDDS>
<Domain>
<General>
<AllowMulticast>true</AllowMulticast>
</General>
<Discovery>
<ParticipantIndex>auto</ParticipantIndex>
</Discovery>
</Domain>
</CycloneDDS>
Loading