micronaut-maven-plugin
micronaut-maven-plugin copied to clipboard
Support proxy build arguments when building Docker images
Working behind a corporate HTTP proxy makes everything harder. Here the docker-native goal fails on yum update && yum install
[INFO] Could not retrieve mirrorlist http://amazonlinux.default.amazonaws.com/2/core/latest/x86_64/mirror.list error was
12: Timeout on http://amazonlinux.default.amazonaws.com/2/core/latest/x86_64/mirror.list: (28, 'Failed to connect to amazonlinux.default.amazonaws.com port 80 after 5001 ms: Timeout was reached')
[ERROR] The command '/bin/sh -c yum update -y && yum install -y gcc gcc-c++ zlib-devel zip tar gzip && yum clean all' returned a non-zero code: 1
[ERROR] Failed to execute goal io.micronaut.build:micronaut-maven-plugin:3.5.3:docker-native (default-docker-native) on project laundry-micronaut-lambda: Execution default-docker-native of goal io.micronaut.build:micronaut-maven-plugin:3.5.3:docker-native failed: Could not build image: The command '/bin/sh -c yum update -y && yum install -y gcc gcc-c++ zlib-devel zip tar gzip && yum clean all' returned a non-zero code: 1
I managed to manually build the docker image by adding docker build args:
docker build --build-arg http_proxy=<proxy host>:<proxy port> --build-arg https_proxy=<proxy host>:<proxy port> .
Is it be possible to control the docker command arguments from Maven configuration?