简体   繁体   中英

Quarkus graalvm native build dockerfile installation fails

I want to deploy a quarkus builder image via a Dockerfile. We are behind a proxy, I set all the linux proxy settings in upper- and lowercase.

If I run the Dockerfile, I get an error message at the gu command to install the native image component . Here is the complete run statement in the Dockerfile:

# Install GraalVM
RUN curl -fsSL https://github.com/oracle/graal/releases/download/vm-${GRAALVM_VERSION}/graalvm-ce-linux-amd64-${GRAALVM_VERSION}.tar.gz > graalvm-ce-${GRAALVM_VERSION}.tar.gz && \
    tar -xvf graalvm-ce-${GRAALVM_VERSION}.tar.gz && \
    rm -f graalvm-ce-${GRAALVM_VERSION}.tar.gz && \
    mv graalvm-ce-${GRAALVM_VERSION} /usr/lib/jvm/ && \
    cd /usr/lib/jvm && \
    ln -sfn graalvm-ce-${GRAALVM_VERSION} graalvm && \
    alternatives --install /usr/bin/java java ${GRAALVM_HOME}bin/java 97

RUN printenv
RUN ${GRAALVM_HOME}bin/gu install native-image

It returns an error message containing that I have to set an http_proxy. Before that run statement I start a printenv statement, as I can see the http_proxy env variable is set.
Before and after that part of the dockerfile we download and install other stuff. That works.

The only thing that don't work is the gu statement.

Here is the returning log message:

Step 10/24 : RUN printenv
 ---> Running in e539ee727135
...
GRAALVM_HOME=/usr/lib/jvm/graalvm/
JAVA_HOME=/usr/lib/jvm/graalvm/
HTTP_PROXY=http://This-is-a:real@proxy.com:8080/
http_proxy=http://This-is-a:real@proxy.com:8080/
HTTPS_PROXY=http://This-is-a:real@proxy.com:8080/
https_proxy=http://This-is-a:real@proxy.com:8080/
GRAALVM_VERSION=19.2.1
...
Removing intermediate container e539ee727135
 ---> de3d463af567
Step 11/24 : RUN ${GRAALVM_HOME}bin/gu available
 ---> Running in d4a04b82279c
Downloading: Component catalog from www.graalvm.org
Error: Error downloading component catalog from https://www.graalvm.org/component-catalog/graal-updater-component-catalog.properties: Invalid argument or cannot assign requested address.
Please check your connection and proxy settings. If your machine is behind a proxy, environment variables (http_proxy, https_proxy, ...) must be set appropriately.
The command '/bin/sh -c ${GRAALVM_HOME}bin/gu install native-image' returned a non-zero code: 3

Found not really a solution, but a workaround. I fetched the component manually and install it via local statement. Here is the Dockerfile snippet to install the native build:

### Install GraalVM native build
RUN curl -fsL -o component.jar https://github.com/oracle/graal/releases/download/vm-${GRAALVM_VERSION}/native-image-installable-svm-linux-amd64-${GRAALVM_VERSION}.jar && \
    ${GRAALVM_HOME}bin/gu install -L component.jar && \
    rm component.jar

That works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM