Docker-Build: Angular Build suddenly doesn’t use at build-time modified files

Below you’ll find a part of my current multistage Dockerfile. Everything works fine, except that the substituted environment variables (see envsubst) are not used in the build process for whatever reason.

As you can see, I’m printing the environment variables (they exist). Furthermore, I’m printing the modified files with cat (they are modified as expected). Nevertheless, the ng build --prod command doesn’t use these files?

Does anyone have an idea what the reason may be? I’ve already tried a lot (even pruning all docker images, I even deleted the tag in the docker registry, …).

    ENV VERSION=${buildVersion} 
    # TODO: Run tests before going on.. --> npm run test --> but Chrome would need to be installed? Headless?
    RUN apk add gettext && 
      printenv && 
      envsubst < ./src/global-styles/color-palette.template.scss > ./src/global-styles/color-palette.scss && 
      envsubst < ./src/environments/ > ./src/environments/ && 
      cat ./src/global-styles/color-palette.scss && 
      cat ./src/environments/ && 
      npm run build:prod -- --output-path=./dist

I would be very grateful for your help, thank you in advance.

Source: Docker Questions