Installing WebSphere Liberty features from a local repository
You can use a locally hosted feature repository to speed up feature installation during builds of your images.
Locally hosting a feature repository
- Download repository files from Fix Central.
-
To host a feature repository on-premises, you can use the
nginx
container image.docker run --name repo-host -v /repo-host:/usr/share/nginx/html:ro -p 8080:80 -d nginx
- You can mount and serve multiple archive files with a container volume mount; for example, a
repo-host folder mounted from host to the
nginx
container. - You can place each compressed file in versioned folders. For example,
repo-host/${LIBERTY_VERSION}/repo.zip
- You need a hostname or IP address and a mapped port to generate
FEATURE_REPO_URL
. For example, in the previous code sample, port 8080 is used.
- You can mount and serve multiple archive files with a container volume mount; for example, a
repo-host folder mounted from host to the
Using a locally hosted feature repository in the Dockerfile
Using the FEATURE_REPO_URL
build argument, you can provide a link to a feature
repository archive file that contains all of the features. Be sure to run the RUN
configure.sh
command in your Dockerfile.
docker build --build-arg
FEATURE_REPO_URL="http://wlprepos:8080/19.0.0.x/repo.zip"
You can also set it in the Dockerfile.
FROM icr.io/appcafe/websphere-liberty:kernel-java8-openj9-ubi
ARG FEATURE_REPO_URL=http://wlprepos:8080/19.0.0.x/repo.zip
ARG VERBOSE=false
RUN configure.sh
This feature requires a curl
command to be in the container image. Some base
images do not provide curl
. You can add it before the configure.sh
command. For example,
FROM icr.io/appcafe/websphere-liberty:kernel-java8-openj9-ubi
USER root
RUN apt-get update && apt-get install -y curl
USER 1001
ARG FEATURE_REPO_URL=http://wlprepos:8080/19.0.0.x/repo.zip
ARG VERBOSE=false
RUN configure.sh