我有一个数据库备份,我想将其还原到在 docker 容器内运行的 postgres 数据库。
我在 OS X 上使用 docker-
machine。Postgres 图像是postgres:9.4
.
这是我到目前为止想出的脚本:
pg_restore --verbose --clean --no-acl --no-owner \
-h tcp://`docker-machine ip default`:5432 \
-U postgres \
-d tonsser-api_development latest.dump
但这不起作用。我得到错误:
pg_restore: connecting to database for restore
pg_restore: [archiver (db)] connection to database "tonsser-api_development" failed: could not translate host name "tcp://192.168.99.100:5432" to address: nodename nor servname provided, or not known