Lately, I'm getting this error when building Ubuntu/Debian based containers:
Warning: apt-key output should not be parsed (stdout is not a terminal)
Executing: /tmp/apt-key-gpghome.jZsMrv3GZH/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
mgpg: cannot open '/dev/tty': No such device or address
When I'm calling the apt-key commands such as these:
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
I could use apt with an untrusted option so I wouldn't need the key at all, but that sounds as a dirty solution.
When using gpg directly I probably could use the --no-tty or --batch options to fix it, but what is the somewhat clean way to do it with apt-key command which is a wrapper for the pgp?