diff options
author | Michal Banka <michal.banka@nokia.com> | 2021-02-12 14:45:59 +0100 |
---|---|---|
committer | Michal Banka <michal.banka@nokia.com> | 2021-02-12 15:26:27 +0100 |
commit | a3e5e53ba4c940642ddd5becacd4b0cf361fb5a4 (patch) | |
tree | 72c1576258600e0de36050e2b8273514d970df3d | |
parent | c5c005a74157d8436bffd714c316ce257d2700ca (diff) |
Update image building
- Removed 'docker' profile
- Removed auto building and pushing image from mvn phases
- Unified image name through project
- Updated README
Signed-off-by: Michal Banka <michal.banka@nokia.com>
Change-Id: I20e5e21d61b5e0283f9de6b9d0b2e0988328537a
Issue-ID: DCAEGEN2-2573
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | README.md | 18 | ||||
-rw-r--r-- | docker-compose.yml | 2 | ||||
-rw-r--r-- | environment.config | 5 | ||||
-rw-r--r-- | pom.xml | 79 |
5 files changed, 46 insertions, 60 deletions
@@ -12,7 +12,7 @@ build: docker: @echo "Building ves-openapi-manager docker image" - @$(DOCKER) build --tag ves-openapi-manager:latest . + @$(DOCKER) build --tag $(IMAGE):latest . run: @echo "Starting ves-openapi-manager docker containers" @@ -65,4 +65,20 @@ Results of validation are visible in two places: - In SDC UI in Service -> Distributions view under specific distribution as component *ves-openapi-manager*. It might take few minutes to show results after service distribution. - In logs of ves-openapi-manager, right after validation takes place. -
\ No newline at end of file + +## Docker image + +### Building +There are at least two ways to build docker image. + +Using makefile: +``` +make build docker +``` + +Direct creation with mvn: +``` +mvn clean package docker:build +``` + +Image will be named: *onap/org.onap.dcaegen2.platform.ves-openapi-manager*
\ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index d708fd8..ce7cb96 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3' services: ves-openapi-manager: - image: ves-openapi-manager:latest + image: onap/org.onap.dcaegen2.platform.ves-openapi-manager:latest container_name: ves-openapi-manager hostname: ves-openapi-manager environment: diff --git a/environment.config b/environment.config index 0d34eef..57dfbe7 100644 --- a/environment.config +++ b/environment.config @@ -1,11 +1,14 @@ # Configuration file for ves-openapi-manager Makefile -# consts +# Consts COMPOSE = docker-compose MVN = mvn DOCKER = docker SSH = ssh +# Image +IMAGE=onap/org.onap.dcaegen2.platform.ves-openapi-manager + # Port-forwarding configuration RKE_IP=10.129.36.103 WORKER_IP=10.129.36.116 @@ -83,64 +83,31 @@ <target>${maven.compiler.target}</target> </configuration> </plugin> + <plugin> + <groupId>io.fabric8</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>${docker-maven-plugin.version}</version> + <configuration> + <skipPush>${skipDockerPush}</skipPush> + <verbose>true</verbose> + <imagePullPolicy>IfNotPresent</imagePullPolicy> + <images> + <image> + <alias>${project.artifactId}</alias> + <name>${docker-image.namespace}/${docker-image.name.prefix}.${project.artifactId}</name> + <registry>${onap.nexus.dockerregistry.daily}</registry> + <build> + <dockerFileDir>${project.basedir}</dockerFileDir> + <tags> + <tag>${project.version}-${maven.build.timestamp}Z</tag> + </tags> + </build> + </image> + </images> + </configuration> + </plugin> </plugins> </build> - <profiles> - <profile> - <id>docker</id> - <activation> - <activeByDefault>false</activeByDefault> - </activation> - <properties> - <os.detected.name>linux</os.detected.name> - <os.detected.arch>x86_64</os.detected.arch> - <os.detected.classifier>${os.detected.name}-${os.detected.arch}</os.detected.classifier> - </properties> - <build> - <plugins> - <plugin> - <groupId>io.fabric8</groupId> - <artifactId>docker-maven-plugin</artifactId> - <version>${docker-maven-plugin.version}</version> - <executions> - <execution> - <id>docker-build-image</id> - <phase>package</phase> - <goals> - <goal>build</goal> - </goals> - </execution> - <execution> - <id>docker-push-image</id> - <phase>deploy</phase> - <goals> - <goal>push</goal> - </goals> - </execution> - </executions> - <configuration> - <skipPush>${skipDockerPush}</skipPush> - <verbose>true</verbose> - <imagePullPolicy>IfNotPresent</imagePullPolicy> - <images> - <image> - <alias>${project.artifactId}</alias> - <name>${docker-image.namespace}/${docker-image.name.prefix}.${project.artifactId}</name> - <registry>${onap.nexus.dockerregistry.daily}</registry> - <build> - <dockerFileDir>${project.basedir}</dockerFileDir> - <tags> - <tag>${project.version}-STAGE-${maven.build.timestamp}Z</tag> - </tags> - </build> - </image> - </images> - </configuration> - </plugin> - </plugins> - </build> - </profile> - </profiles> <dependencyManagement> <dependencies> |