While testing password_hash() in PHP 7.2, I noticed that the 7.2-alpine Docker image seems to lack the PASSWORD_ARGON2I constant.
Example of error:
$ docker run --rm -it library/php:7.2-alpine ash
/ # php -r "echo PASSWORD_ARGON2I . PHP_EOL;"
Warning: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP) in Command line code on line 1
PASSWORD_ARGON2I
Example of expected behavior (using the 7.2 image):
$ docker run --rm -it library/php:7.2 bash
root@068d1b669538:/# php -r "echo PASSWORD_ARGON2I . PHP_EOL;"
2
I don't know if it's related to the LibreSSL configuration discussion here, but this seemed worth mentioning since the new password hashing stuff is one of the great benefits of PHP 7.2
From https://github.com/docker-library/php/issues/515#issuecomment-344445069
Looks like the library is
libargon2-0-devin Debian -- it's in Alpine also (argon2-dev), but only inedge.
Unfortunately this is still true, so perhaps with Alpine 3.8 we can have the argon2 library.
Create an issue on https://bugs.alpinelinux.org/ and it might get backported.
I think updating to Alpine 3.8 (now that it's released) is probably our best bet forward here (ala https://github.com/docker-library/php/issues/683).
I think updating to Alpine 3.8 (now that it's released) is probably our best bet forward here (ala #683).
Yes, #677 adds support for Argon 2 to the Alpine 3.8 based images: https://github.com/docker-library/php/pull/677/commits/7e230c9648870f5b98f9906b90397b0be5a8b531
Woot, this is fixed (and will be published once https://github.com/docker-library/official-images/pull/4752 merges). :+1:
Thanks @TimWolla and @forevermatt!