Building with external include directories using Docker

When trying to use liboscore as an external module, I get the following error when trying to build with docker (using BUILD_WITH_DOCKER=1 in the environment variables):

cc1: error: -I/data/riotbuild/src/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/nanocoap/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/libcose/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/src/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/nanocoap/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/libcose/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/src/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/src/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/src/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/src/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/nanocoap/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/libcose/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/src/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/nanocoap/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/libcose/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/src/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/nanocoap/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/libcose/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/nanocoap/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/libcose/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/src/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/nanocoap/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/libcose/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/src/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/nanocoap/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/libcose/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/src/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/nanocoap/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/libcose/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/src/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/nanocoap/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/libcose/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/src/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/nanocoap/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/libcose/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/src/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/nanocoap/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/libcose/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/src/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/nanocoap/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/libcose/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/src/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/nanocoap/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/libcose/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/src/include: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/nanocoap/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/nanocoap/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/libcose/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/nanocoap/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/libcose/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: -I/data/riotbuild/backends/libcose/inc: No such file or directory [-Werror=missing-include-dirs]
cc1: error: unrecognized command line option '-Wno-array-parameter' [-Werror]
[...]

even if I correct the Makefile.include file for the current state. Has anyone an idea how to fix that? Currently, I am working on a branch based on 2022.01 and using the riot/riotbuild:2022.01 image (but latest doesn’t work either).