dockerfile creating a user and assign a group at the same time code example
Example 1: add user to docker group
sudo usermod -aG docker $USER #$USER is your username
Example 2: add user to docker group
sudo gpasswd -a $USER docker
sudo usermod -aG docker $USER #$USER is your username
sudo gpasswd -a $USER docker