Created
June 12, 2024 23:21
-
-
Save apivovarov/158902525fea1230e444e45aff6a5f23 to your computer and use it in GitHub Desktop.
start-docker as user
This file contains 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
docker run -ti --name u2204 -v ~/workspace:/home/joshcao/workspace ubuntu:22.04 | |
U=pivovaa | |
apt update | |
apt install -y adduser sudo vim wget curl \ | |
libssl-dev \ | |
python3 python3-pip | |
adduser $U | |
usermod -aG sudo $U | |
visudo (add NOPASSWD: to Line 50) | |
# Allow members of group sudo to execute any command | |
%sudo ALL=(ALL:ALL) NOPASSWD: ALL | |
cp /root/.bashrc /root/.profile /home/$U/ | |
chown $U /home/$U/.bashrc /home/$U/.profile | |
su - $U |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment