buildpacks / lifecycle

Reference implementation of the Cloud Native Buildpacks lifecycle
https://buildpacks.io
Apache License 2.0
185 stars 103 forks source link

Build metadata should contain meta-buildpacks that participated in the build #324

Open ekcasey opened 4 years ago

ekcasey commented 4 years ago

When an app image built using a metabuildpack, the image metadata only contains information about the implementation buildpacks that participated. Information about the detected metabuildpack is lost

docker inspect petclinic | jq -r '.[].Config.Labels["io.buildpacks.build.metadata"]' | jq .buildpacks
[
  {
    "id": "paketo-buildpacks/bellsoft-liberica",
    "version": "2.8.0"
  },
  {
    "id": "paketo-buildpacks/executable-jar",
    "version": "1.2.7"
  },
  {
    "id": "paketo-buildpacks/apache-tomcat",
    "version": "1.3.0"
  },
  {
    "id": "paketo-buildpacks/dist-zip",
    "version": "1.3.5"
  },
  {
    "id": "paketo-buildpacks/spring-boot",
    "version": "1.8.1"
  }
]

This is potentially confusing becasey users explicitly requesting a buildpack:

> pack build -p ./spring-petclinic/target/spring-petclinic-2.2.0.BUILD-SNAPSHOT.jar --buildpack paketo-buildpacks/java petclinic

may reasonably expect to see the buildpack they requested in the image metadata. Instead, the metadata gives the false impression that paketo-buildpacks/java did not participate in the build.

> pack inspect-image petclinic
Inspecting image: petclinic
...
Buildpacks:
  ID                                         VERSION
  paketo-buildpacks/bellsoft-liberica        2.8.0
  paketo-buildpacks/executable-jar           1.2.7
  paketo-buildpacks/apache-tomcat            1.3.0
  paketo-buildpacks/dist-zip                 1.3.5
  paketo-buildpacks/spring-boot              1.8.1
loewenstein-sap commented 1 month ago

It's actually going to be hierarchical, isn't it? Something like this, ...

> pack inspect-image petclinic
Inspecting image: petclinic
...
Buildpacks:
  ID                                           VERSION
  paketo-buildpacks/java                       1.2.3
    paketo-buildpacks/bellsoft-liberica        2.8.0
    paketo-buildpacks/executable-jar           1.2.7
    paketo-buildpacks/apache-tomcat            1.3.0
    paketo-buildpacks/dist-zip                 1.3.5
    paketo-buildpacks/spring-boot              1.8.1

Is that what others have in mind as well?

jjbustamante commented 1 month ago

Is that what others have in mind as well?

Yeah @loewenstein-sap , that makes sense to me.