OCI image spec labels for API 97/129697/2
authordanielhanrahan <daniel.hanrahan@est.tech>
Mon, 27 Jun 2022 15:23:29 +0000 (16:23 +0100)
committerdanielhanrahan <daniel.hanrahan@est.tech>
Tue, 28 Jun 2022 10:35:58 +0000 (11:35 +0100)
Issue-ID: POLICY-4253
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
Change-Id: I994f16f3c6432a77b1b4c1468e0ca299a0db9624

packages/policy-api-docker/pom.xml
packages/policy-api-docker/src/main/docker/Dockerfile
packages/policy-api-docker/src/main/docker/suse.Dockerfile

index 219aa48..d9c47bb 100644 (file)
                 </executions>
             </plugin>
 
+            <plugin>
+                <groupId>io.github.git-commit-id</groupId>
+                <artifactId>git-commit-id-maven-plugin</artifactId>
+                <version>5.0.0</version>
+                <executions>
+                    <execution>
+                        <id>get-the-git-infos</id>
+                        <goals>
+                            <goal>revision</goal>
+                        </goals>
+                        <phase>initialize</phase>
+                    </execution>
+                </executions>
+                <configuration>
+                    <skipPoms>false</skipPoms>
+                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
+                    <includeOnlyProperties>
+                        <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
+                        <includeOnlyProperty>^git.commit.id.abbrev$</includeOnlyProperty>
+                    </includeOnlyProperties>
+                    <commitIdGenerationMode>full</commitIdGenerationMode>
+                </configuration>
+            </plugin>
+
             <plugin>
                 <groupId>io.fabric8</groupId>
                 <artifactId>docker-maven-plugin</artifactId>
index ee315ed..7fd6da9 100644 (file)
@@ -3,6 +3,7 @@
 # ============LICENSE_START=======================================================
 #  Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
 #  Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
+#  Modifications Copyright (C) 2022 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 FROM onap/policy-jre-alpine:2.4.3
 
 LABEL maintainer="Policy Team"
+LABEL org.opencontainers.image.title="Policy API"
+LABEL org.opencontainers.image.description="Policy API image based on Alpine"
+LABEL org.opencontainers.image.url="https://github.com/onap/policy-api"
+LABEL org.opencontainers.image.vendor="ONAP Policy Team"
+LABEL org.opencontainers.image.licenses="Apache-2.0"
+LABEL org.opencontainers.image.created="${git.build.time}"
+LABEL org.opencontainers.image.version="${git.build.version}"
+LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}"
 
 ARG POLICY_LOGS=/var/log/onap/policy/api
 
@@ -43,4 +52,4 @@ RUN chown -R policy:policy * && chmod 755 bin/*.sh && chown -R policy:policy /ap
 
 USER policy
 WORKDIR $POLICY_HOME/bin
-ENTRYPOINT [ "./policy-api.sh" ]
\ No newline at end of file
+ENTRYPOINT [ "./policy-api.sh" ]
index 67a73bb..c855c3a 100644 (file)
@@ -1,9 +1,7 @@
 #-------------------------------------------------------------------------------
 # Dockerfile
 # ============LICENSE_START=======================================================
-#  Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
-#  Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
-#  Modifications Copyright (C) 2022 Nordix Foundation.
+#  Copyright (C) 2022 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 FROM opensuse/leap:15.3
 
 LABEL maintainer="Policy Team"
+LABEL org.opencontainers.image.title="Policy API"
+LABEL org.opencontainers.image.description="Policy API image based on OpenSuse"
+LABEL org.opencontainers.image.url="https://github.com/onap/policy-api"
+LABEL org.opencontainers.image.vendor="ONAP Policy Team"
+LABEL org.opencontainers.image.licenses="Apache-2.0"
+LABEL org.opencontainers.image.created="${git.build.time}"
+LABEL org.opencontainers.image.version="${git.build.version}"
+LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}"
 
 ARG POLICY_LOGS=/var/log/onap/policy/api