Error occuring while running mvn install of hello world microservice

I am getting error in building hello-world microservice

[INFO]
[INFO] — microservice-package-maven-plugin:1015.0.278:package (package) @ hello-microservice-java —
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Manifest contains no buildspec and target architectures. Using defaults
[INFO] Starting docker microservice build for the following target architectures: [linux/amd64]
[INFO] docker container hello-microservice-java in network ‘’
[INFO] copy resources from Resource {targetPath: null, filtering: true, FileSet {directory: C:\untitled\target\tmp, PatternSet [includes: {}, excludes: {}]}} toC:\untitled\target\docker-work
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] copy resources from Resource {targetPath: null, filtering: true, FileSet {directory: C:\untitled\src\main\configuration, PatternSet [includes: {}, excludes: {}]}} toC:\untitled\target\docker-work\etc
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] copy resources from Resource {targetPath: null, filtering: true, FileSet {directory: C:\untitled\src\main\docker, PatternSet [includes: {}, excludes: {}]}} toC:\untitled\target\docker-work
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\untitled\src\main\docker
[INFO] Building microservice image for target architecture linux/amd64
[INFO] Building Docker image. Docker dir=C:\untitled\target\docker-work,tags=[hello-microservice-java:1.0.0, hello-microservice-java:latest], build arguments={}, platform=linux/amd64
[INFO] Waiting for image build to complete (timeout=360s)
[INFO] Step 1/6 : FROM alpine:3

[INFO]
[INFO] — microservice-package-maven-plugin:1015.0.278:package (package) @ hello-microservice-java —
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Manifest contains no buildspec and target architectures. Using defaults
[INFO] Starting docker microservice build for the following target architectures: [linux/amd64]
[INFO] docker container hello-microservice-java in network ‘’
[INFO] copy resources from Resource {targetPath: null, filtering: true, FileSet {directory: C:\untitled\target\tmp, PatternSet [includes: {}, excludes: {}]}} toC:\untitled\target\docker-work
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] copy resources from Resource {targetPath: null, filtering: true, FileSet {directory: C:\untitled\src\main\configuration, PatternSet [includes: {}, excludes: {}]}} toC:\untitled\target\docker-work\etc
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] copy resources from Resource {targetPath: null, filtering: true, FileSet {directory: C:\untitled\src\main\docker, PatternSet [includes: {}, excludes: {}]}} toC:\untitled\target\docker-work
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\untitled\src\main\docker
[INFO] Building microservice image for target architecture linux/amd64
[INFO] Building Docker image. Docker dir=C:\untitled\target\docker-work,tags=[hello-microservice-java:1.0.0, hello-microservice-java:latest], build arguments={}, platform=linux/amd64
[INFO] Waiting for image build to complete (timeout=360s)
[INFO] Step 1/6 : FROM alpine:3
[INFO]
[INFO] —> b2aa39c304c2
[INFO] Step 2/6 : RUN apk add --no-cache coreutils openjdk11
[INFO]
[INFO] —> Running in 2b98115f0bc5
[INFO] fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/main/x86_64/APKINDEX.tar.gz
[INFO] 48CB23F7017F0000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1889:
[INFO] WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.17/main: Permission denied
[INFO] fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/community/x86_64/APKINDEX.tar.gz
[INFO] 48CB23F7017F0000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1889:
[INFO] WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.17/community: Permission denied
[INFO] ERROR: unable to select packages:
[INFO] coreutils (no such package):
required by: world[coreutils]
openjdk11 (no such package):
required by: world[openjdk11]
[ERROR] Docker build error: 2 The command ‘/bin/sh -c apk add --no-cache coreutils openjdk11’ returned a non-zero code: 2
[ERROR] Waiting for Docker completion was interrupted

Hi,

I tried to reproduce the problem but building the hello-world microservice worked for me. I deleted all cached Docker images to build from scratch and it still works. Specifically, the step that fails for you (installing packages on the alpine base image) works.

Could this be a network issue on your side? Are you using a proxy or a VPN that might be terminating TLS connections? Can you try from a different network?

Best regards,
Harald

It might be related to some security software like Zscaler running in your network, see:

This is caused because you don’t have the correct certificate setup. Your local environmernt is probably missing the cert or CA that is being given by the remote host.

The easiest solution, but also not very secure is to tell maven to ignore SSL errors by adding the following option.

-Dmaven.wagon.http.ssl.insecure=true

regards,
John.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.