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