1.docker pull docker.io/postgres:11
2.启动命令脚本
vi startPostgres.sh
填入以下内容:
docker run -d --name postgresql-11 \
--restart=always \
-v /postgresql/data:/var/lib/postgresql/data \
-e POSTGRES_PASSWORD=123456 \
-p 5432:5432 \
docker.io/postgres:11
3.给脚本写权限:
chmod +x startPostgres.sh
4.执行启动脚本:
./startPostgres.sh
5.查看日志,启动报错:
docker logs postgresql-11
2019-06-13 12:35:21.977 UTC [1] FATAL: configuration file "/var/lib/postgresql/data/postgresql.conf" contains errors
2019-06-13 12:35:23.182 UTC [1] LOG: invalid value for parameter "lc_messages": "zh_CN.UTF-8"
2019-06-13 12:35:23.182 UTC [1] LOG: invalid value for parameter "lc_monetary": "zh_CN.UTF-8"
2019-06-13 12:35:23.182 UTC [1] LOG: invalid value for parameter "lc_numeric": "zh_CN.UTF-8"
2019-06-13 12:35:23.182 UTC [1] LOG: invalid value for parameter "lc_time": "zh_CN.UTF-8"