0

I have been battling with this issue for a few days now and I'm stumped. It's probably something simple I've overlooked.

I have a docker-project written using docker-compose. The file is here 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'

The build process imports several dockerfiles but the relevant one is 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

This configuration worked fine for a previous build of the database. Note, the address for the database is contained in the vvta_docker.df file if needed. The build process is (in-draft) documented in DOCKER.md and I always "prune" all containers while building test releases.

- Pull images

```bash
$ docker-compose pull
  • Create a directory for sharing resources between your computer and the container
$ mkdir ~/variantvalidator_data
$ mkdir ~/variantvalidator_data/share

i.e. a directory called share in your home directory

  • Build
$ docker-compose build --no-cache
  • Complete build
    • The first time you do this, it will complete the build process, for example, populating the required the databases
    • When this is completed you will need to shutdown the services and re-start (see below)
$ docker-compose up
  • Shutdown services when you want to stop the container
ctrl + c

However, I keep getting an error /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/VVTA_2021_2_noseq.psql.gz. I will attach the full (relevant) trace below

I hope it's OK to use links. It's more understandable to me and hopefully easier for you all.

Things I've tried Increasing the docker partition space and memory and cores Alternate configurations e.g. This one I have found relatively similar items on Stack Overflow, but not quite sure how relevant they are

Docker build trace

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
3
  • Please include enough information to reproduce the issue in the question itself, not behind links. Especially links to GitHub are prone to losing context, since you're probably going to commit and update the file once you've fixed the issue. See How to Ask in the SO Help Center for more details. Commented Jul 23, 2021 at 14:20
  • Thanks David. I will update Commented Jul 23, 2021 at 14:59
  • I have added the relevant text now, but also kept the links just in case anyone needs to try and reproduce Commented Jul 23, 2021 at 15:04

1 Answer 1

1

The Docker Hub postgres image page notes:

If you would like to do additional initialization in an image derived from this one, add one or more *.sql, *.sql.gz, or *.sh scripts under /docker-entrypoint-initdb.d....

The file you have doesn't match one of these three patterns, though, its filename ends with .psql.gz. You need to rename it when you download it:

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 ........ ^^^
Sign up to request clarification or add additional context in comments.

2 Comments

Oh nice. Typical it's an obvious thing when you look again. Thanks very much David. Really appreciate it. Can't believe I missed that
I changed the line to RUN wget --output-document=VTA_2021_2_noseq.sql.gz 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 and now working perfectly. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.