Skip to content

Commit

Permalink
docs: Add labels to Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
2b-t committed Feb 3, 2024
1 parent 0b85906 commit 178c871
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
11 changes: 9 additions & 2 deletions templates/ros/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected]"
LABEL description="ROS Noetic Docker template"
LABEL version="1.0"

WORKDIR ${CATKIN_WORKSPACE_DIR}
SHELL ["/bin/bash", "-c"]

ENV DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -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} \
Expand Down
11 changes: 9 additions & 2 deletions templates/ros2/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected]"
LABEL description="ROS 2 Humble Docker template"
LABEL version="1.0"

WORKDIR ${AMENT_WORKSPACE_DIR}
SHELL ["/bin/bash", "-c"]

ENV DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -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} \
Expand Down

0 comments on commit 178c871

Please sign in to comment.