Created
August 4, 2020 14:51
-
-
Save webflo-dev/9d099339a6f10f506d6da270178eb963 to your computer and use it in GitHub Desktop.
ubuntu image with non-root user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:latest | |
RUN apt -y update && \ | |
apt -y full-upgrade && \ | |
apt -y autoremove && \ | |
apt -y install sudo zsh git curl | |
RUN useradd -U -m john && \ | |
usermod -aG sudo -s /bin/zsh john && \ | |
echo "john ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/john && \ | |
chmod 0440 /etc/sudoers.d/john && \ | |
echo "Set disable_coredump false" >> /etc/sudo.conf && \ | |
touch /home/john/.zshrc && \ | |
chown john:john /home/john/.zshrc | |
USER john | |
WORKDIR /home/john |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment