Docker marks localhost as insecure by default. I assume that the reasoning behind that is to enable an easy and straight-forward way to develop and test against a local registry running on the same host. Note that there doesn't seem to be a restriction regarding ports.
I think containers/image should follow the example as I think that users expect this behaviour.