StacksJar
Made with π by Arif Shaikh with all Passion.
Docker Filesystems and Docker containers work in a similar manner to filesystems outside a Docker container. You must have the write permissions if you want to create files or directories inside Docker Containers.
First Check if the User you are has the needed permissions. To create a Folder as a non-root user inside the / folder doesn't work because it is owned by the root user and has typically dr-xr-xr-x settings enabled.
To create directories with non-root users try below command:
RUN mkdir -p /newfolder RUN chown newuser /newfolder USER newuser WORKDIR /newfolder
To provide all users read/write/execute permission, Update the directory on the Docker system to have 0777 or drwxrwxrwx permssions.
chmod 0777 /usr/local/docker/foo