There is a Node.js code running well in the alpine node Docker container in Linux (and macOS) environments.
import fs from 'fs';
...
const processorDir = path.join(LOCAL_PROC_PATH, 'processor');
if (!fs.existsSync(processorDir)) {
fs.mkdirSync(processorDir);
}
In Windows in same alpine node Docker container it fails with:
Error: EACCES: permission denied, mkdir '/mnt/app/processor'
Replacing with the following did not help
import fs from 'fs-extra';
...
fs.ensureDirSync(processorDir);
In Dockerfile, we have
RUN mkdir -p /mnt/app/
RUN chown -R node:node /mnt/app/
USER node
/mnt/app/ above is the LOCAL_PROC_PATH. So the node user can create dirs for processing. And it does in Linux environment.
The attempt to create and use another Linux user and assign the admin privilege led to the same error.