By default, AWI v24.4 loads the icon at path /awi/@theme/favicon_default_32.svg
. If a session color is specified by the user, the AWI loads an icon at the path awi/@theme/favicon_32_rgbhex.svg
where rgbhex is the hexadecimal RGB color code, e.g., E6E6E6. The session color-specific SVG files are generated dynamically. The AWI appears to use the file favicon_32.svg
as a template, replacing the magenta color #DE1E7E in this SVG file with the chosen session color. (I haven‘t tested this, but if my understanding is correct, it means that it‘s possible to create a custom icon that still responds dynamically to the user‘s selected session color.)
Here's a Dockerfile for a modified AWI v24.4 image with a customized favorite icon.
# syntax=docker/dockerfile:1.10
# Insert environment-specific color-coded AWI favorite icon into webui-vaadin-framework-theme.jar
# Define build arguments with default values
ARG REGISTRY="containerregistry.mycompany.com"
ARG AWI_REPOSITORY="awi"
ARG VERSION="24.4.0.2"
# Stage 1: Define the source image explicitly, because variables are not supported in the --from option of COPY
FROM ${AWI_REGISTRY}/${AWI_REPOSITORY}:${AWI_VERSION} AS awi_image
# Stage 2: Use a standard Ubuntu base image for performing modifications on the JAR file.
FROM ubuntu:latest as builder
# Install zip and unzip commands
RUN apt-get update && apt-get install -y zip
# Copy the JAR from the awi image
COPY --from=awi_image /usr/awi/plugins/framework-bundles/webui-vaadin-framework-theme.jar /tmp/webui-vaadin-framework-theme.jar
# Create a directory structure that mirrors what's in the JAR.
RUN mkdir -p /tmp/themes/oneui
# Replace the ICO and SVG files inside the JAR in the builder stage
COPY favicon.ico /tmp/themes/oneui/favicon.ico
COPY favicon_default_32.svg /tmp/themes/oneui/favicon_default_32.svg
COPY favicon_32.svg /tmp/themes/oneui/favicon_32.svg
# Repack the JAR file in the builder stage
RUN cd /tmp && zip webui-vaadin-framework-theme.jar themes/oneui/favicon.ico themes/oneui/favicon_default_32.svg themes/oneui/favicon_32.svg
# Stage 3: Use the vendor image to run the app
FROM awi_image
# Copy the modified JAR file from the builder stage to the final image
COPY --from=builder /tmp/webui-vaadin-framework-theme.jar /usr/awi/plugins/framework-bundles/webui-vaadin-framework-theme.jar
# Start the AWI. These statements are based on the way Broadcom's own AWI image works.
CMD ["cd", "/usr/awi"]
ENTRYPOINT ["/bin/sh", "-c", "./entrypoint.sh"]
This has been tested successfully with AWI v24.4.0.2.
Build arguments cannot be used in COPY statements, so you must provide your custom icon in three files named exactly favicon.ico
, favicon_default_32.svg
, and favicon_32.svg
.
In our environment, we automate this in the deployment pipeline. There’s a step in the pipeline that copies the icon files for the target environment from git, to the file names expected by the Dockerfile.