Problem Description
Can not create folder during image building with non root user added to sudoers group. Here is my Dockerfile:
FROM ubuntu:16.04
RUN apt-get update && \
apt-get -y install sudo
RUN adduser --disabled-password --gecos '' newuser \
&& adduser newuser sudo \
&& echo '%sudo ALL=(ALL:ALL) ALL' >> /etc/sudoers
USER newuser
RUN mkdir -p /newfolder
WORKDIR /newfolder
I get error: `mkdir: cannot create directory '/newfolder': Permission denied`
AI-Generated Solution
Powered by LMSouq AI · GPT-4.1-mini
Analyzing problem and generating solution…
Was this solution helpful?