Step-by-Step Guide to Backing Up and Restoring PostgreSQL in Docker

$containerName = "my_postgres_container";
$dbUser = "postgres_user";
$database = "my_database";

docker exec -t $containerName pg_dumpall -c -U $dbUser > database-dump.sql

# stop the container and remove the data volume
# start the container normally

cat database-dump.sql | docker exec -i $containerName psql -U $dbUser -d $database

How to Fix Docker Daemon Port Binding Error on Windows

Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:54328 -> 0.0.0.0:0: listen tcp 0.0.0.0:54328: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
Fix it by opening CMD As Admin and run in sequence:
net stop winnat
net start winnat