-
Notifications
You must be signed in to change notification settings - Fork 443
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
Entrypoint script ignoring non files #78
Conversation
LGTM, cc @tianon |
@@ -105,6 +105,10 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then | |||
|
|||
echo | |||
for f in /docker-entrypoint-initdb.d/*; do | |||
if [ ! -f "$f" ]; then | |||
echo "$0: ignoring is not a file $f"; echo | |||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a mix of spaces and tabs -- should be just tabs. 😉
Also, would you mind changing the output to the following? (so that it matches the following output lines better)
echo "$0: ignoring $f (not a file)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
- `cassandra`: 3.2 (docker-library/cassandra#47), run as non-root and allow arbitrary `--user` (docker-library/cassandra#48) - `celery`: 3.1.20 - `mariadb`: resync entrypoint with MySQL (MariaDB/mariadb-docker#37, MariaDB/mariadb-docker#34) - `memcached`: fix SHA1 checking (docker-library/memcached#6) - `mongo`: 3.0.9, conditional chown, configdb (MariaDB/mariadb-docker#78) - `mysql`: fix init failure a bit (docker-library/mysql#134) - `percona`: resync entrypoint with MySQL (docker-library/percona#12) - `php`: update FPM to use `php-fpm.d` for config (docker-library/php#184) - `postgres`: remove EOL 9.0 (docker-library/postgres#122) - `python`: remove EOL 3.2 (docker-library/python#87) - `rabbitmq`: allow for arbitrary `--user` (docker-library/rabbitmq#60) - `rails`: 4.2.5.1 - `redmine`: add SCMs (docker-library/redmine#9) - `rocket.chat`: 0.15.0 (RocketChat/Docker.Official.Image#13) - `ruby`: silence `root` warning (docker-library/ruby#63)
Finally coming back to this old issue. 🙇♂️ My overall opinion of this is that it is working correctly. Having the script fail when a user bind mounts a non-existent file (and it becomes a folder in the container) probably means that they misspelled the file name and they should get an error. |
If a SQL file does not exist in the docker machine to be mounted, the mount point is created as an empty folder. This pull request prevents the entrypoint script stop because of this.