Skip to content

Conversation

@tianon
Copy link
Member

@tianon tianon commented Aug 11, 2017

Closes #233

I verified this by doing the following:

$ docker run -dit --name mysql -e MYSQL_ROOT_PASSWORD=$'\na\nb\nc\n' mysql:5.7
fdc19dd20c8a203c5614272d760c557c49ec3fff8646fe555043862738f46b4f
$ docker exec -it mysql mysql -uroot -p$'\na\nb\nc\n' -e 'SELECT 1'
mysql: [Warning] Using a password on the command line interface can be insecure.
+---+
| 1 |
+---+
| 1 |
+---+
$ docker run -it --rm -e WORDPRESS_DB_PASSWORD=$'\na\nb\nc\n' --name wordpress --link mysql:mysql ee9b41f73de3
...

(Where ee9b41f73de3 is an image built with this change.)

Then I hit my new wordpress container from the browser and went through the setup process.

Without this change, the WORDPRESS_DB_PASSWORD variable having newlines in it causes sed: -e expression #1, char 80: unterminated s' command` (as in #233).

@tianon
Copy link
Member Author

tianon commented Aug 11, 2017

Here's the DB_PASSWORD value this creates:

define('DB_PASSWORD', '' + "\n" + 'a' + "\n" + 'b' + "\n" + 'c' + "\n" + '');

@yosifkit yosifkit merged commit 28bdfe3 into docker-library:master Aug 11, 2017
@yosifkit yosifkit deleted the mysql-newline-passwords branch August 11, 2017 23:06
yosifkit added a commit to infosiftr/stackbrew that referenced this pull request Aug 16, 2017
- `gcc` bump to `7.2.0`
- `ghost` bump to `1.6.1`
- `nextcloud` bump to `12.0.2`
- `rabbitmq` bump to `3.6.11`
- `wordpress` support newlines in sql password docker-library/wordpress#234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants