That's not a fair analogy.
Docker is still free to use to build your own things today. You can run containers on your servers and pay $0. You can host images on your own registry and Docker makes $0 off that, you can still provide free value to the community by allowing the community to pull from your registry at no cost.
An accurate analogy would be more like Elixir officially hosting all open source Elixir apps for free for ~10 years and now 10 years later you want to start charging a relatively small amount of money to continue hosting things for the community. That doesn't seem unreasonable to me and that's what Docker is doing here.