I figured out:
the flag --chmod
is a new feature from Docker Buildkit, so it is necessary to run the build enabling it via:
DOCKER_BUILDKIT=1 docker build ./
However, it is really not clear why Docker swallows the --chmod
option without any error or warn about the non-existing option 😕.