aica-technology / docker-images

Docker images and tools for ROS and AICA
MIT License
7 stars 1 forks source link

fix: define all build args at the top of the Dockerfile #110

Closed eeberhard closed 6 months ago

eeberhard commented 6 months ago

Description

Fix following build failure here:

Build args need to be declared at the top layer, otherwise they might be skipped in intermediate layers and remain undefined. As part of this, I removed the secondary declarations of the build args in the later layer.

Review guidelines

Estimated Time of Review: 1.1 minutes

Checklist before merging:

LouisBrunner commented 6 months ago

This is incorrect and actually breaks the metadata:

                "devcontainer.metadata": "[{\"containerUser\": \"ros2\"}]",
                "org.opencontainers.image.base.name": ":",
                "org.opencontainers.image.description": "AICA base ROS 2 image (includes ros2_control)",
                "org.opencontainers.image.ref.name": "ubuntu",
                "org.opencontainers.image.title": "AICA ROS 2 image",
                "org.opencontainers.image.version": "",
                "tech.aica.image.metadata": "{\"type\":\"base/ws\",\"base\":{\"name\":\"${BASE_IMAGE}:${BASE_TAG}\",\"version\":\"${VERSION}\"}}"

Stages only inherit the ARG from the stages they inherit from and top-level ARG are seemingly only associated with the first stage, resulting in empty metadata (some is also badly formatted, introduced in https://github.com/aica-technology/docker-images/pull/109#discussion_r1598375768).