I’m having some trouble with building my Docker image. I installed sudo in an Ubuntu image, committed the changes and pushed it into a repository on my Docker Hub account, and then pulled from it in my Dockerfile. And I added a normal user to the sudoers group in the Dockerfile. But now I can’t create directories or clone from a GitHub repository into my home directory in the Dockerfile container without using sudo.
Link to Dockerfile on my OneDrive. The error I got is:
Step 7/24 : RUN mkdir /home/osman/app/scripts /home/osman/app/styles
—> Running in eede92832c73
mkdir: cannot create directory ‘/home/osman/app/scripts’: Permission denied
mkdir: cannot create directory ‘/home/osman/app/styles’: Permission denied
The command ‘/bin/sh -c mkdir /home/osman/app/scripts /home/osman/app/styles’ returned a non-zero code: 1
I’m using Docker Toolbox version 18.03.0-ce, build 0520e24302. OS is Windows 10 Home Single Language, version 1803 build 17134.345. My code is on GitHub here. The one inside the directory with the Dockerfile has a difference compared to the one on GitHub, but it’s mostly the same. The difference is: in the scripts.js file, the POST action value for the form is https://dragonscurrencyconv.herokuapp.com (because I want to deploy the Docker image to Heroku at that address – address won’t work at the moment, though).