sudo docker pull postgres mkdir -p /data/docker/pgsql sudo docker run -p 54321:5432 --name pgsql -v /data/docker/pgsql:/var/lib/postgresql -d postgres sudo docker start pgsql sudo docker exec -it pgsql bash psql -U postgres ALTER USER postgres WITH PASSWORD '新密碼'; \q exit