Skip to content

mount volume script is ignored. #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Congrammers opened this issue Dec 11, 2017 · 5 comments
Closed

mount volume script is ignored. #2

Congrammers opened this issue Dec 11, 2017 · 5 comments

Comments

@Congrammers
Copy link

Congrammers commented Dec 11, 2017

based on this issue docker-library/postgres#193

From the readme, the mount volume usage is broken

@mrts
Copy link
Owner

mrts commented Dec 11, 2017

Can you be more specific? What did you do, what happened?

Works well for me, so I would like to get more information.

@Congrammers
Copy link
Author

My project Directory looks like:

.
├── myapp
|  ├── Dockerfile
|  └── script
|     └── docker-posgresql-multiple-databases
│        └── create-multiple-postgresql-databases.sh
└── docker-compose.yml
db_dev:
    image: postgres:9.6.6
    environment:
      POSTGRES_PASSWORD: mysecretlocalpassword
      POSTGRES_USER: postgres
      POSTGRES_MULTIPLE_DATABASES: myapp_db_development,myapp_db_test
    volumes:
      - ./myapp/script/docker-posgresql-multiple-databases:/docker-entrypoint-initdb.d

So, I want to use it by mounting the script as a volume, when I try to run the docker-compose file. The script within docker-entrypoint-initdb.d is ignored. The log returned so:

db_dev_1        | server started
db_dev_1        | ALTER ROLE
db_dev_1        | 
db_dev_1        | 
db_dev_1        | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
db_dev_1        | 
db_dev_1        | waiting for server to shut down....LOG:  received fast shutdown request
db_dev_1        | LOG:  aborting any active transactions
db_dev_1        | LOG:  autovacuum launcher shutting down
db_dev_1        | LOG:  shutting down
db_dev_1        | LOG:  database system is shut down
db_dev_1        |  done
db_dev_1        | server stopped

But when I try using it from the image:

  db_dev:
    image: postgres-multi-db
    environment:
      POSTGRES_PASSWORD: mysecretlocalpassword
      POSTGRES_USER: postgres
      POSTGRES_MULTIPLE_DATABASES: myapp_db_development,myapp_db_test

building it in-before,
docker build -t=postgres-multi-db ./aloha/script/docker-postgresql-multiple-databases;
it works just fine.

As explained by yosifkit in here and here, the problem stem from the official image itself. I'm looking for a workaround for using the mount volume method instead of building images.

@a13xg0
Copy link
Contributor

a13xg0 commented Dec 13, 2017

Hello! I think this issue about typo in the example, see my PR.

@mrts
Copy link
Owner

mrts commented Dec 13, 2017

Many thanks to @a13xg0! However, looking at @Congrammers config, he has the typo in the folder name, so it should work... and the logs clearly tell that the folder contents are ignored.

@Congrammers
Copy link
Author

Yeah it's working now; The error that the 'scriptfile is ignored' indicated that the file is useless (probably empty, wrong extension etc..).

I figured this when it's actually working. It ignored the README.md and another file within the folder, thanks for everyone guidance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants