I'm creating a docker file from ubuntu:bionic image.
I want an ubuntu user with sudo privileges.
This is my Dockerfile
FROM ubuntu:bionic
ENV DEBIAN_FRONTEND noninteractive
# Get the basic stuff
RUN apt-get update && \
apt-get -y upgrade && \
apt-get install -y \
sudo
# Create ubuntu user with sudo privileges
RUN useradd -ms /bin/bash ubuntu && \
usermod -aG sudo ubuntu
# Set as default user
USER ubuntu
WORKDIR /home/ubuntu
ENV DEBIAN_FRONTEND teletype
CMD ["/bin/bash"]
But with this aproach I need to write the password of ubuntu user.
There is a way to add NOPASSWD clausule to sudo group in sudoers file by command line?