I have the bin directory in the build directory of my project.
When I run the command ./bin/cov-build --dir cov-int make
I get the following error -
[ERROR] Failed to initialize ICU, try using the --prevent-root option.
After I copied the correct set of dirs, the error went away and I could execute cov-configure python
...
COPY --from=prepare-install /opt/coverity/analysis/bin /opt/coverity/analysis/bin
COPY --from=prepare-install /opt/coverity/analysis/bin/cov-* /opt/coverity/analysis/bin/
COPY --from=prepare-install /opt/coverity/analysis/config/parse_warnings.conf.sample /opt/coverity/analysis/config/parse_warnings.conf.sample
COPY --from=prepare-install /opt/coverity/analysis/config/user_nodefs.h /opt/coverity/analysis/config/user_nodefs.h
COPY --from=prepare-install /opt/coverity/analysis/config/wrapper_escape.conf /opt/coverity/analysis/config/wrapper_escape.conf
# ls /opt/coverity/analysis/config/templates/ | xargs -I {} echo "COPY --from=prepare-install /opt/coverity/analysis/config/templates/{} /opt/coverity/analysis/config/templates/{}"
COPY --from=prepare-install /opt/coverity/analysis/config/templates/python /opt/coverity/analysis/config/templates/python
# File doesn't exist: '/opt/coverity/analysis/config/templates/generic/generic_switches.dat'
COPY --from=prepare-install /opt/coverity/analysis/config/templates/generic /opt/coverity/analysis/config/templates/generic
COPY --from=prepare-install /opt/coverity/analysis/config/templates/generic_linker /opt/coverity/analysis/config/templates/generic_linker
COPY --from=prepare-install /opt/coverity/analysis/config/templates/xlc /opt/coverity/analysis/config/templates/xlc
# Addressing the error
# > [coverity-python 6/6] RUN cov-configure --python: No valid XML DTD catalog found, try using the --prevent-root option.
COPY --from=prepare-install /opt/coverity/analysis/certs /opt/coverity/analysis/certs
COPY --from=prepare-install /opt/coverity/analysis/dtd /opt/coverity/analysis/dtd
COPY --from=prepare-install /opt/coverity/analysis/xsl /opt/coverity/analysis/xsl
# Was failing with https://stackoverflow.com/questions/65184937/fatal-python-error-init-fs-encoding-failed-to-get-the-python-codec-of-the-file
# As it is configured with python3.9, not python3.7 as it is packaged
COPY --from=prepare-install /opt/coverity/analysis/lib/python3.9 /opt/coverity/analysis/lib/python3.9
...
...
```console
$ docker images | more
REPOSITORY TAG IMAGE ID SIZE
dockerhub.company.com/coverity/python:2022.6.0 605MB
Coverity uses ICU to handle multibyte encodings. This requires the ICU data files, present in the Coverity installation. That error suggests those files are either missing or not present in the expected location, and suggests you try using
--prevent-root
to tell it where it can expect to find the files.Did you only copy the bin directory to your project? This would likely explain the issue, and using
--prevent-root
to point to the actual Coverity installation should resolve it.