That's essentially what Docker hub already is. you can do
docker pull postgres
and get a postgres service which runs in a container.
docker pull postgres
and get a postgres service which runs in a container.
the commands needed are right there on the docker hub page