I tried to install netcat like this but it fails since I am not able to answer the question. Is there any way to specify the answer for the prompt without having to run in interactive mode?
$ docker exec nginx apt-get install netcat
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
netcat-traditional
The following NEW packages will be installed:
netcat netcat-traditional
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 75.9 kB of archives.
After this operation, 156 kB of additional disk space will be used.
Do you want to continue? [Y/n] Abort.
$