Adding GPG key inside docker container causes "no valid OpenPGP data found"

The solution provided by @xdays works around the problem, but also works around the protection that ssl is providing. You could install the ca-certificates package before issuing your wget statement and it should work with ssl.

Add the following line before your call to wget:

RUN apt-get install -y ca-certificates wget

I ran into this issue when i was installing docker.

run sudo apt install apt-transport-https ca-certificates curl software-properties-common

You can refer here.

And then curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -