Amazon Linux add user to group

The current shell was initialized before you added yourself to the group, so it cannot reflect a later change to your group memberships. You can

exec sg docker

to replace the current shell with a new one which is explicitly switched to the group you added yourself to, or simply log out and back in.