Unable to connect to postgres inside a docker container
postgres peer authentication depends on the linux/unix user that runs psql being the same as user in the -U postgres parameter. As you are running on root locally this isn't true.
Having a postgres user outside the container won't necessary map to the postgres user inside the container.
Recommend changing authentication mechanisms