From 178c87161eaa28fd1ba3b7a99da05ff3685b7b12 Mon Sep 17 00:00:00 2001 From: Tobit Flatscher <53856473+2b-t@users.noreply.github.com> Date: Sat, 3 Feb 2024 23:45:28 +0000 Subject: [PATCH] docs: Add labels to Docker image --- templates/ros/docker/Dockerfile | 11 +++++++++-- templates/ros2/docker/Dockerfile | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/templates/ros/docker/Dockerfile b/templates/ros/docker/Dockerfile index c0d3fcb..ab90eb9 100644 --- a/templates/ros/docker/Dockerfile +++ b/templates/ros/docker/Dockerfile @@ -4,8 +4,12 @@ FROM ros:noetic-robot as base ARG CATKIN_WORKSPACE_DIR=${CATKIN_WORKSPACE_DIR} -WORKDIR ${CATKIN_WORKSPACE_DIR} +LABEL org.opencontainers.image.authors="tobit.flatscher@outlook.com" +LABEL description="ROS Noetic Docker template" +LABEL version="1.0" + +WORKDIR ${CATKIN_WORKSPACE_DIR} SHELL ["/bin/bash", "-c"] ENV DEBIAN_FRONTEND=noninteractive @@ -50,7 +54,10 @@ RUN apt-get update \ ENV DEBIAN_FRONTEND=dialog -RUN addgroup --gid ${GID} ${USERNAME} \ +RUN apt-get update \ + && apt-get install -y sudo \ + && rm -rf /var/lib/apt/lists/* \ + && addgroup --gid ${GID} ${USERNAME} \ && adduser --disabled-password --gecos '' --uid ${GID} --gid ${GID} ${USERNAME} \ && echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} \ && chown -R ${UID}:${GID} /home/${USERNAME} \ diff --git a/templates/ros2/docker/Dockerfile b/templates/ros2/docker/Dockerfile index fa619a3..52e417c 100644 --- a/templates/ros2/docker/Dockerfile +++ b/templates/ros2/docker/Dockerfile @@ -4,8 +4,12 @@ FROM ros:humble-ros-base as base ARG AMENT_WORKSPACE_DIR=${AMENT_WORKSPACE_DIR} -WORKDIR ${AMENT_WORKSPACE_DIR} +LABEL org.opencontainers.image.authors="tobit.flatscher@outlook.com" +LABEL description="ROS 2 Humble Docker template" +LABEL version="1.0" + +WORKDIR ${AMENT_WORKSPACE_DIR} SHELL ["/bin/bash", "-c"] ENV DEBIAN_FRONTEND=noninteractive @@ -55,7 +59,10 @@ RUN apt-get update \ ENV DEBIAN_FRONTEND=dialog -RUN addgroup --gid ${GID} ${USERNAME} \ +RUN apt-get update \ + && apt-get install -y sudo \ + && rm -rf /var/lib/apt/lists/* \ + && addgroup --gid ${GID} ${USERNAME} \ && adduser --disabled-password --gecos '' --uid ${GID} --gid ${GID} ${USERNAME} \ && echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} \ && chown -R ${UID}:${GID} /home/${USERNAME} \