Anyone ever run into permission issues running the script?
For example:
server started
/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/create-multiple-postgres-databases.sh
/usr/local/bin/docker-entrypoint.sh: /docker-entrypoint-initdb.d/create-multiple-postgres-databases.sh: /bin/bash: bad interpreter: Permission denied
I figure out this problem with change volume config. Don't attach whole /docker-entrypoint-initdb.d directory as volume. Then not permitted a directory copied to container. Solution was add all files one by one. like below;
/docker-entrypoint-initdb.d
volumes: - ./db_init/db_init.sh:/docker-entrypoint-initdb.d/db_init.sh
Well... in case any other poor soul stumbles onto this problem, you have to set the script as executable because Docker copies over permissions...
chmod +x pg-init-scripts/create-multiple-postgres-databases.sh
I also created an account just to thank you
I created an account just to thank you
😂 Your welcome!
i've already done that. but still no database created
You'll need to then run docker-compose up -d again and if needed, create your new database from an sql script.
docker-compose up -d
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Anyone ever run into permission issues running the script?
For example:
server started
/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/create-multiple-postgres-databases.sh
/usr/local/bin/docker-entrypoint.sh: /docker-entrypoint-initdb.d/create-multiple-postgres-databases.sh: /bin/bash: bad interpreter: Permission denied
I figure out this problem with change volume config. Don't attach whole
/docker-entrypoint-initdb.d
directory as volume. Then not permitted a directory copied to container. Solution was add all files one by one. like below;Well... in case any other poor soul stumbles onto this problem, you have to set the script as executable because Docker copies over permissions...
I also created an account just to thank you
I created an account just to thank you
😂 Your welcome!
i've already done that. but still no database created
You'll need to then run
docker-compose up -d
again and if needed, create your new database from an sql script.I also created an account just to thank you