Tag: 转储

如何从主机恢复MySQL转储到Docker容器

我确定这是一个重复的话题,但我根本无法完成:我喜欢在运行时将我的数据库转储恢复到MySQL容器,而无需修改docker-compose.yml文件。 Dockerfile FROM php:5.4.45-apache RUN apt-get update RUN docker-php-ext-install mysql mysqli 泊坞窗,compose.yml version: '2' services: php_service: container_name: my_php # Use Dockerfile in this dir to build the image build: . # Stop containers always after exiting. restart: always ports: # 'localhost' does not works from the host, but the IP of docker itself # (192.168.99.100 […]

离线恢复PostgreSQL数据库

我想在inheritance自官方PostgreSQL映像的Docker容器中提供初始数据。 有没有一种方法可以在数据库服务器不运行时从命令行(使用pg_restore )恢复PostgreSQL转储? 我发现下面的工作,但不使用pg_restore : gosu postgres postgres –single -jE <<-EOSQL CREATE LANGUAGE plpythonu; EOSQL 我已经阅读了官方页面中 docker-entrypoint-initdb.d ,但它只接受原始SQL,并且希望将对官方映像的修改降到最低。