Skip to content

Commit 60b9daa

Browse files
author
Laurent Gougeon
committed
Adding licenses and other files to Docker images.
1 parent d1287ee commit 60b9daa

File tree

5 files changed

+58
-28
lines changed

5 files changed

+58
-28
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,5 +297,7 @@ Additionally, you can find the OpenECPDS options for various editors at this lin
297297
This project automates the downloading of specific tools (GraalVM, Maven, Docker, Kompose, Kubectl). Additionally, it uses external APIs that are downloaded via Maven. For licenses and details on these dependencies, please refer to their respective documentation. You can retrieve the licenses from the development container using:
298298

299299
```bash
300-
mvn dependency:copy-dependencies
300+
make get-licenses
301301
```
302+
303+
If successful, the licenses will be available in the `target/generated-resources` directory. These licenses are also included in the root directory of the container images, along with the `AUTHORS`, `LICENSE.txt`, `NOTICE` and `VERSION` files.

docker/Makefile

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ RESET := \033[0m
2626
DOCKER_HOST_OS ?= $(shell uname -s)
2727
DOCKER_GUEST_OS := $(shell uname -s)
2828

29-
# How to get the rpms?
30-
COPY := cp ../target/rpm
29+
# Source directories for the rpms and licences
30+
RPM_DIR := ../target/rpm
31+
LICENSES_DIR := ../target/generated-resources
3132

3233
# Detect container manager (Docker or Podman)
3334
ifeq ($(shell command -v podman 2> /dev/null),)
@@ -45,30 +46,35 @@ DOCKER_VERSION := $(shell $(DOCKER) --version)
4546
HTTPS_ACCESS := $(shell curl -s --max-time 2 -I https://google.com | sed 's/^[^ ]* *\([0-9]\).*/\1/; 1q')
4647

4748
# Output the help for each task
48-
.PHONY: help all get-rpms build images bk-images rm-images clean .clean info
49+
.PHONY: help all get-rpms get-licenses build images bk-images rm-images clean .clean info
4950

5051
help: ## Show this help message
5152
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
5253

5354
# Display help by default
5455
.DEFAULT_GOAL := help
5556

56-
all: ## Get RPMs, and build images
57+
all: ## Get RPMs, licenses and build images
5758
@$(MAKE) get-rpms
59+
@$(MAKE) get-licenses
5860
@$(MAKE) build
5961

6062
.https-access: ## Check HTTPS access (required to build images)
6163
@if [ "$(HTTPS_ACCESS)" != "2" -a "$(HTTPS_ACCESS)" != "3" ]; then \
6264
printf "$(RED)** HTTPS connectivity is down **$(RESET)\n" && exit 1; \
6365
fi
6466

65-
get-rpms: ## Get RPMs from the RPMS directory in rpmbuild
67+
get-rpms: ## Get RPMs from the source RPM directories
6668
@$(MAKE) .get-rpm app=mover rpm=mover arch=noarch
6769
@$(MAKE) .get-rpm app=master rpm=master arch=noarch
6870
@$(MAKE) .get-rpm app=monitor rpm=monitor arch=noarch
6971

7072
.get-rpm: # Create the target directory and get the specified RPM (args: app, rpm, arch)
71-
mkdir -p ecpds/$(app)/rpms && $(COPY)/ecpds-$(rpm)/RPMS/$(arch)/ecpds-$(rpm)-$(TAG).$(arch).rpm ecpds/$(app)/rpms/.
73+
mkdir -p ecpds/$(app)/rpms && cp -f $(RPM_DIR)/ecpds-$(rpm)/RPMS/$(arch)/ecpds-$(rpm)-$(TAG).$(arch).rpm ecpds/$(app)/rpms/.
74+
75+
get-licenses: ## Get the licenses for the java image
76+
cp -fr $(LICENSES_DIR)/licenses* ecpds/java/.
77+
cp -f ../AUTHORS ../LICENSE.txt ../NOTICE ../VERSION ecpds/java/.
7278

7379
build: .https-access ## Build database, Java, and service images
7480
@$(MAKE) .build app=database tag=$(TAG)
@@ -118,10 +124,11 @@ push: .checkcr ## Push images to CR
118124
$(DOCKER) push $(CR_URL)/$(app):$(tag)
119125
$(DOCKER) push $(CR_URL)/$(app)
120126

121-
clean: ## Remove all RPMs
127+
clean: ## Remove all RPMs and licenses
122128
@$(MAKE) .clean app=mover
123129
@$(MAKE) .clean app=master
124130
@$(MAKE) .clean app=monitor
131+
cd ecpds/java && rm -fr AUTHORS LICENSE.txt NOTICE VERSION licenses*
125132

126133
.clean: # Remove RPMs for the specified app (arg: app)
127134
rm -f ecpds/$(app)/rpms/ecpds-*-*.*.rpm

docker/ecpds/java/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
AUTHORS
2+
LICENSE.txt
3+
NOTICE
4+
VERSION
5+
licenses.xml
6+
licenses

docker/ecpds/java/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ RUN java -Xshare:dump
3030

3131
# Re-enable disabled algorithms to allow connecting to low security sites
3232
COPY java.security $JAVA_HOME/conf/security/.
33+
34+
# Copy licences and related files
35+
COPY AUTHORS LICENSE.txt NOTICE VERSION licenses.xml .
36+
COPY licenses /licenses

pom.xml

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
<groupId>ecmwf</groupId>
66
<artifactId>product-data-store</artifactId>
77
<version>6.7.9</version>
8-
<name>Product Data Store (PDS)</name>
8+
<name>Product Data Store (OpenECPDS)</name>
99
<description>Product Data Store for Acquisition and Dissemination activities</description>
10-
<url>
11-
https://www.ecmwf.int/en/newsletter/159/computing/ecmwf-production-data-store</url>
10+
<url>https://github.com/ecmwf/open-ecpds</url>
1211
<packaging>jar</packaging>
1312
<properties>
1413
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -213,23 +212,6 @@
213212
</execution>
214213
</executions>
215214
</plugin>
216-
<plugin>
217-
<groupId>org.codehaus.mojo</groupId>
218-
<artifactId>license-maven-plugin</artifactId>
219-
<version>2.4.0</version>
220-
<configuration>
221-
<failOnBlacklist>true</failOnBlacklist>
222-
<includedLicenses>
223-
<includedLicense>Apache-2.0</includedLicense>
224-
</includedLicenses>
225-
<licenseName>apache_v2</licenseName>
226-
<organizationName>ECMWF</organizationName>
227-
<inceptionYear>2004</inceptionYear>
228-
<includes>
229-
<include>**/*.java</include>
230-
</includes>
231-
</configuration>
232-
</plugin>
233215
<plugin>
234216
<groupId>org.apache.maven.plugins</groupId>
235217
<artifactId>maven-dependency-plugin</artifactId>
@@ -252,6 +234,35 @@
252234
</execution>
253235
</executions>
254236
</plugin>
237+
<plugin>
238+
<groupId>org.codehaus.mojo</groupId>
239+
<artifactId>license-maven-plugin</artifactId>
240+
<version>2.4.0</version>
241+
<dependencies>
242+
<dependency>
243+
<groupId>org.apache.logging.log4j</groupId>
244+
<artifactId>log4j-core</artifactId>
245+
<version>2.24.0</version>
246+
</dependency>
247+
<dependency>
248+
<groupId>org.apache.logging.log4j</groupId>
249+
<artifactId>log4j-api</artifactId>
250+
<version>2.24.0</version>
251+
</dependency>
252+
</dependencies>
253+
<configuration>
254+
<errorRemedy>ignore</errorRemedy>
255+
</configuration>
256+
<executions>
257+
<execution>
258+
<id>download-licenses</id>
259+
<phase>prepare-package</phase>
260+
<goals>
261+
<goal>download-licenses</goal>
262+
</goals>
263+
</execution>
264+
</executions>
265+
</plugin>
255266
<plugin>
256267
<groupId>org.owasp</groupId>
257268
<artifactId>dependency-check-maven</artifactId>

0 commit comments

Comments
 (0)