pg_restore in postgres docker container

后端 未结 2 2339
情话喂你
情话喂你 2021-02-20 18:46

I am trying to restore database in PostgreSQL docker container using pg_restore from a shellscript taht will be called from docker file .I am getting following error \"E

2条回答
  •  南方客
    南方客 (楼主)
    2021-02-20 19:29

    I don't think the backup restore can be done during the initialization phase. Start your container and then upload the db.

    docker run -d --name mydb mypgimage
    docker exec mydb sh -c "pg_restore -C -d DB /var/lib/postgresql/backup/DB.backup"
    

提交回复
热议问题