-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Skip reverse DNS lookups #89
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
Conversation
$ ./generate-stackbrew-library.sh | sed -r 's/docker-library/infosiftr/' > mysql
$ ./bashbrew/bashbrew.sh build ../mysql/mysql
Cloning mysql (git://github.com/infosiftr/mysql) ...
Processing mysql:5.5.45 ...
Processing mysql:5.5 ...
Processing mysql:5.6.26 ...
Processing mysql:5.6 ...
Processing mysql:5 ...
Processing mysql:latest ...
Processing mysql:5.7.7-rc ...
Processing mysql:5.7.7 ...
Processing mysql:5.7 ...
$ ./bashbrew/bashbrew.sh list --uniq ../mysql/mysql | xargs ./test/run.sh
testing mysql:5.5.45
'utc' [1/4]...passed
'cve-2014--shellshock' [2/4]...passed
'no-hard-coded-passwords' [3/4]...passed
'mysql-basics' [4/4]...passed
testing mysql:5.6.26
'utc' [1/4]...passed
'cve-2014--shellshock' [2/4]...passed
'no-hard-coded-passwords' [3/4]...passed
'mysql-basics' [4/4]...passed
testing mysql:5.7.7-rc
'utc' [1/4]...passed
'cve-2014--shellshock' [2/4]...passed
'no-hard-coded-passwords' [3/4]...passed
'mysql-basics' [4/4]...mysqld failed to accept connections in a reasonable amount of time!
ERROR 2003 (HY000): Can't connect to MySQL server on 'mysql' (111)
failed |
RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/my.cnf | ||
# don't reverse lookup hostnames, they are usually another container | ||
RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/my.cnf \ | ||
&& echo 'skip-host-cache\nskip-name-resolve' | awk '{ print } /^\[mysqld\]$/ && c == 0 { c = 1; system("cat") }' /etc/mysql/my.cnf > /tmp/my.cnf \ |
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 regex condition could instead be $1 == "[mysqld]"
.
I'm definitely a fan of skipping these by default for the image, especially since so many users will be behind at least Docker's NAT by default, so incoming connections won't resolve and we're just wasting precious time. ping @ltangvald; what're your thoughts here? |
08e7be7
to
6d1c7c7
Compare
This leaves the [mysqld]
+skip-host-cache
+skip-name-resolve
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock |
👍 |
LGTM |
- `celery`: docker-library/celery@033c91f - `elasticsearch`: docker-library/elasticsearch@4e491a7 - `ghost`: docker-library/ghost@7200faa - `hello-world`: docker-library/hello-world@2224815 - `irssi`: jessfraz/irssi@46f8d10 - `mongo`: 2.6.11 - `mysql`: `skip-name-resolve` (docker-library/mysql#89) - `owncloud`: 7.0.8 and 8.1.1 - `php`: docker-library/php@7575282 - `postgres`: 9.5~alpha2-1.pgdg80+1 - `redis`: redis/docker-library-redis@d2877d5 - `redmine`: infosiftr/redmine@dbd8af6 - `ruby`: `--no-document` (docker-library/ruby#49) - `wordpress`: fix FPM support (docker-library/wordpress#92)
I believe this breaks permissions/grants in certain cases? Can this be a setting? Or, how do you override "skip-name-resolve" in a file in the conf.d directory? |
Sorry for the delay, @joshunger; I would imagine something like |
- `celery`: docker-library/celery@033c91f - `elasticsearch`: docker-library/elasticsearch@4e491a7 - `ghost`: docker-library/ghost@7200faa - `hello-world`: docker-library/hello-world@2224815 - `irssi`: jessfraz/irssi@46f8d10 - `mongo`: 2.6.11 - `mysql`: `skip-name-resolve` (docker-library/mysql#89) - `owncloud`: 7.0.8 and 8.1.1 - `php`: docker-library/php@7575282 - `postgres`: 9.5~alpha2-1.pgdg80+1 - `redis`: redis/docker-library-redis@d2877d5 - `redmine`: infosiftr/redmine@dbd8af6 - `ruby`: `--no-document` (docker-library/ruby#49) - `wordpress`: fix FPM support (docker-library/wordpress#92)
fixes #52