Hi@Roshin,
When you use sudo command, it will ask the password. But docker doesn't give you any tty to put your password. To avoid this error you can set NOPASSWD for your user in /etc/sudoers file as given below.
$ vi /etc/sudoers
user ALL=(ALL) NOPASSWD: ALL