Create relative paths for compiler_commands.json

I am working on a project where the code is currently compiled inside a linux container.
When I instruct cmake to write the file it uses absolute paths.

cmake -S /app/opt/myApp -B /app/opt/myApp -DCMAKE_EXPORT_COMPILE_COMMANDS=YES

Which results in compiler_commands.json containing absolute paths to both the compiler and the other libraries. Once I debug the program outside of the container, my Language Server (clangd) will read the compile_commands.json file. Then return values that can only be resolved within the container.

How can i make the compile_commands.json file use relative paths?

Is there a way to make it write with paths with environment variables like %PATH%, %HOME%,etc?