WASdev/ci.docker

Dockerfile ARG FEATURE_REPO_URL does not seem to work with an on-premise Maven repository

faandg opened this issue · 6 comments

Hi,

After some research and testing I was unable to find a way to use our on-premise Nexus as a Maven proxy to install features during a docker build.
Is this not possible or does this require a different format?

different attempts below

10:58:18  + '[' https://nexus.mycompany.be ']'
10:58:18  + curl -k --fail https://nexus.mycompany.be
10:58:18    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
10:58:18                                   Dload  Upload   Total   Spent    Left  Speed
10:58:18  
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  8708  100  8708    0     0   327k      0 --:--:-- --:--:-- --:--:--  327k
10:58:18  + installUtility install --acceptLicense defaultServer --from=/tmp/repo.zip
10:58:19  Checking for missing features required by the server ...
10:58:19  The server requires the following additional features: ejbLite-3.2 servlet-4.0 ssl-1.0 jndi-1.0 cdi-2.0 mpHealth-2.2 transportSecurity-1.0 jaxws-2.2 jdbc-4.2 localConnector-1.0 appSecurity-3.0 jsonp-1.1 jaxrsClient-2.1 jaxrs-2.1 mpConfig-1.4 monitor-1.0 ldapRegistry-3.0 jpaContainer-2.2 json-1.0 distributedMap-1.0 jpa-2.2 mpMetrics-2.3.  Installing features from the repository ...
10:58:19  CWWKF1442E: /tmp/repo.zip is not a valid directory-based repository. Rerun the command with a valid directory-based repository. 
11:07:29  + '[' https://nexus.mycompany.be/maven-public ']'
11:07:29  + curl -k --fail https://nexus.mycompany.be/maven-public
11:07:29    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
11:07:29                                   Dload  Upload   Total   Spent    Left  Speed
11:07:29  
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
11:07:29  curl: (22) The requested URL returned error: 404 Not Found
11:07:30  error building at STEP "RUN configure.sh": error while running runtime: exit status 22
11:07:30  level=error msg="exit status 22"
16:27:18  + '[' https://nexus.mycompany.be/repository/maven-public ']'
16:27:18  + curl -k --fail https://nexus.mycompany.be/repository/maven-public
16:27:18    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
16:27:18                                   Dload  Upload   Total   Spent    Left  Speed
16:27:18  
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
16:27:18  curl: (22) The requested URL returned error: 400 Repository path must have another '/' after initial '/'
16:27:18  error building at STEP "RUN configure.sh": error while running runtime: exit status 22
16:27:18  level=error msg="exit status 22"
16:46:56  + '[' https://nexus.mycompany.be/repository/maven-public/ ']'
16:46:56  + curl -k --fail https://nexus.mycompany.be/repository/maven-public/
16:46:56    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
16:46:56                                   Dload  Upload   Total   Spent    Left  Speed
16:46:56  
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  2312  100  2312    0     0  82571      0 --:--:-- --:--:-- --:--:-- 82571
16:46:56  + installUtility install --acceptLicense defaultServer --from=/tmp/repo.zip
16:46:58  Checking for missing features required by the server ...
16:46:58  The server requires the following additional features: ejbLite-3.2 servlet-4.0 ssl-1.0 jndi-1.0 cdi-2.0 mpHealth-2.2 transportSecurity-1.0 jaxws-2.2 jdbc-4.2 localConnector-1.0 appSecurity-3.0 jsonp-1.1 jaxrsClient-2.1 jaxrs-2.1 mpConfig-1.4 monitor-1.0 ldapRegistry-3.0 jpaContainer-2.2 json-1.0 distributedMap-1.0 jpa-2.2 mpMetrics-2.3.  Installing features from the repository ...
16:46:58  CWWKF1442E: /tmp/repo.zip is not a valid directory-based repository. Rerun the command with a valid directory-based repository. 

Thanks in advance.

@faandg Are you still encountering this issue?

@leochr Yes. There have however been some changes to the documentation regarding features.sh so I will see if I can retest it.

@leochr The problem is that FEATURE_REPO_URL only allows a file-based proxy (for a wlp-feature-repo from Fix Central) and that seems to be hardcoded into configure.sh which is provided with the image:

  if [ "$FEATURE_REPO_URL" ]; then
    curl -k --fail $FEATURE_REPO_URL > /tmp/repo.zip
    installUtility install --acceptLicense defaultServer --from=/tmp/repo.zip || if [ $? -ne 22 ]; then exit $?; fi
    rm -rf /tmp/repo.zip
  else
    installUtility install --acceptLicense defaultServer || if [ $? -ne 22 ]; then exit $?; fi
  fii
  fi

If this could leverage the featureUtility it would probably support this

(tested on 21.0.0.12)

Support is now added for using featureUtility which is delivered in #467 and is available in the latest 23.0.0.5 release.

To use featureUtility, add the RUN features.sh command prior to RUN configure.sh (example in README) which supports overriding with an on-premise Maven repositories as outlined by the featureUtility docs.

Closing this issue because the feature is now supported.