To remove a user from a group on Linux, one can use gpasswd or deluser. Here are sample commands.
Using gpasswd
To remove user1 from group docker on any Linux
$ sudo gpasswd -d user1 docker Removing user user1 from group docker
Using deluser (Ubuntu)
To remove user1 from group docker on Ubuntu Linux
$ sudo deluser user1 docker