[英]Initialize postgres database (without using /docker-entrypoint-initdb.d)
[英]ignoring /docker-entrypoint-initdb.d error for Postgres database in a configuration that previously worked
幾天來我一直在與這個問題作斗爭,我很難過。 這可能是我忽略的一些簡單的事情。
我有一個使用 docker-compose 編寫的 docker-project。 文件在這里docker-compose.yml
version: '3'
services:
vdb:
build:
context: .
dockerfile: vdb_docker.df
ports:
- "33060:3306"
expose:
- "33060"
vvta:
build:
context: .
dockerfile: vvta_docker.df
ports:
- "54320:5432"
expose:
- "54320"
seqrepo:
build:
context: .
dockerfile: vvsr_docker.df
volumes:
- seqdata:/usr/local/share/seqrepo
vv:
build: .
depends_on:
- vdb
- vvta
volumes:
- seqdata:/usr/local/share/seqrepo
- share:/usr/local/share
volumes:
share:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '${HOME}/variantvalidator_data/share'
seqdata:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '${HOME}/variantvalidator_data/share/seqrepo'
構建過程會導入多個dockerfiles,但相關的是vvta_docker.df
FROM postgres:latest
ENV POSTGRES_DB=vvta
ENV POSTGRES_USER=vvta_admin
ENV POSTGRES_PASSWORD=vvta_admin
RUN apt-get update && apt-get install -y wget && rm -rf /var/lib/apt/lists/*
RUN wget https://www528.lamp.le.ac.uk/vvdata/vvta/VVTA_2021_2_noseq.psql.gz -O /docker-entrypoint-initdb.d/VVTA_2021_2_noseq.psql.gz
此配置適用於先前構建的數據庫。 請注意,如果需要,數據庫地址包含在 vvta_docker.df 文件中。 構建過程(草案中)記錄在DOCKER.md 中,我總是在構建測試版本時“修剪”所有容器。
- Pull images
```bash
$ docker-compose pull
$ mkdir ~/variantvalidator_data
$ mkdir ~/variantvalidator_data/share
即在您的主目錄中名為 share 的目錄
$ docker-compose build --no-cache
$ docker-compose up
ctrl + c
但是,我不斷收到錯誤/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/VVTA_2021_2_noseq.psql.gz
。 我將在下面附上完整的(相關)跟蹤
我希望可以使用鏈接。 這對我來說更容易理解,希望對你們所有人更容易。
事情我已經嘗試過增加泊塢窗分區空間,內存和核心的可選配置,例如這一次,我發現對堆棧溢出比較類似的項目,但不太清楚他們是如何相關的
Docker 構建跟蹤
vvta_1 | ok
vvta_1 | syncing data to disk ... ok
vvta_1 |
vvta_1 |
vvta_1 | Success. You can now start the database server using:
vvta_1 |
vvta_1 | pg_ctl -D /var/lib/postgresql/data -l logfile start
vvta_1 |
vvta_1 | initdb: warning: enabling "trust" authentication for local connections
vvta_1 | You can change this by editing pg_hba.conf or using the option -A, or
vvta_1 | --auth-local and --auth-host, the next time you run initdb.
vvta_1 | waiting for server to start....2021-07-23 13:09:52.135 UTC [47] LOG: starting PostgreSQL 12.6 (Debian 12.6-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
vvta_1 | 2021-07-23 13:09:52.137 UTC [47] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
vvta_1 | 2021-07-23 13:09:52.193 UTC [48] LOG: database system was shut down at 2021-07-23 13:09:51 UTC
vvta_1 | 2021-07-23 13:09:52.205 UTC [47] LOG: database system is ready to accept connections
vvta_1 | done
vvta_1 | server started
vvta_1 | CREATE DATABASE
vvta_1 |
vvta_1 |
vvta_1 | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/VVTA_2021_2_noseq.psql.gz
vvta_1 |
vvta_1 | waiting for server to shut down...2021-07-23 13:09:52.603 UTC [47] LOG: received fast shutdown request
vvta_1 | .2021-07-23 13:09:52.604 UTC [47] LOG: aborting any active transactions
vvta_1 | 2021-07-23 13:09:52.614 UTC [47] LOG: background worker "logical replication launcher" (PID 54) exited with exit code 1
vvta_1 | 2021-07-23 13:09:52.615 UTC [49] LOG: shutting down
vvta_1 | 2021-07-23 13:09:52.648 UTC [47] LOG: database system is shut down
vvta_1 | done
vvta_1 | server stopped
vvta_1 |
vvta_1 | PostgreSQL init process complete; ready for start up.
vvta_1 |
vvta_1 | 2021-07-23 13:09:52.722 UTC [1] LOG: starting PostgreSQL 12.6 (Debian 12.6-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
vvta_1 | 2021-07-23 13:09:52.730 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
vvta_1 | 2021-07-23 13:09:52.730 UTC [1] LOG: listening on IPv6 address "::", port 5432
vvta_1 | 2021-07-23 13:09:52.735 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
vvta_1 | 2021-07-23 13:09:52.758 UTC [75] LOG: database system was shut down at 2021-07-23 13:09:52 UTC
vvta_1 | 2021-07-23 13:09:52.768 UTC [1] LOG: database system is ready to accept connections
如果您想在從該映像派生的映像中進行額外的初始化,請在
/docker-entrypoint-initdb.d
... 下添加一個或多個*.sql
、*.sql.gz
或*.sh
腳本。
您擁有的文件與這三種模式之一不匹配,但其文件名以.psql.gz
。 下載時需要重命名:
RUN wget https://www528.lamp.le.ac.uk/vvdata/vvta/VVTA_2021_2_noseq.psql.gz \
-O /docker-entrypoint-initdb.d/VVTA_2021_2_noseq.sql.gz
# change this filename to remove "p" here ........ ^^^
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.