Skip to content

Commit

Permalink
feat: add metadata through LABELs (aica-technology#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisBrunner authored and domire8 committed Apr 30, 2024
1 parent d38900e commit 654f6c7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/reusable-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,21 @@ jobs:

- id: tags
run: |
BUILD_FLAGS=()
BUILD_FLAGS=()
BASE_TAG=${{ inputs.ros_distro }}
BUILD_FLAGS+=(--build-arg BASE_TAG=${BASE_TAG})
echo "::debug::Using base image tag ${BASE_TAG}"
echo "build_flags=${BUILD_FLAGS[@]}" >> $GITHUB_OUTPUT
VERSION_TAG="v${{ needs.check-version.outputs.version }}"
IMAGE_TAGS="${VERSION_TAG},${VERSION_TAG}-${{ inputs.ros_distro}}","${{ inputs.ros_distro}}"
GIT_TAG="${{ inputs.ros_distro}}-${VERSION_TAG}"
BUILD_FLAGS+=(--build-arg VERSION=${GIT_TAG})
echo "::debug::Using base image tag ${BASE_TAG}"
echo "Build flags: ${BUILD_FLAGS[@]}"
echo "Image tags: ${IMAGE_TAGS}"
echo "Git tag: ${GIT_TAG}"
echo "build_flags=${BUILD_FLAGS[@]}" >> $GITHUB_OUTPUT
echo "image_tags=${IMAGE_TAGS}" >> $GITHUB_OUTPUT
echo "git_tag=${GIT_TAG}" >> $GITHUB_OUTPUT
Expand Down
9 changes: 9 additions & 0 deletions ros2_ws/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,12 @@ COPY --from=ros2-control / /

# start as ROS user
USER ${USER}

# Metadata
ARG VERSION
ARG BASE_TAG
LABEL org.opencontainers.image.title="AICA ROS2 image"
LABEL org.opencontainers.image.description="AICA base ROS2 image (includes ros2_control)"
LABEL org.opencontainers.image.version="${VERSION}"
LABEL org.opencontainers.image.base.name="docker.io/library/ros:${BASE_TAG}"
LABEL tech.aica.image.metadata='{"type":"base/ws","base":{"name":"docker.io/library/ros","version":"'${BASE_TAG}'"}}'

0 comments on commit 654f6c7

Please sign in to comment.