Running node.js script: docker run --rm \ -e LOCAL_USER_ID=`id -u $USER`\ -v ~/script_folder:/app \ conmio/node:8-alpine node script.js When LOCAL_USER_ID is passed to container, files written to volumes from within the container will be owned by that user.