php: Error "Could not gather sufficient random data" with PHP 7.0-alpine

When using the php:7.0-alpine

$ docker run --rm php:7.0-alpine php -r "random_int(0, 1);"

Fatal error: Uncaught Exception: Could not gather sufficient random data in Command line code:1
Stack trace:
#0 Command line code(1): random_int(0, 1)
#1 {main}
  thrown in Command line code on line 1

Whereas the same call to other version (like php 7.1-alpine or 7.0) works $ docker run --rm php:7.1-alpine php -r "random_int(0, 1);" $ docker run --rm php:7.0 php -r "random_int(0, 1);"

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 16 (2 by maintainers)

Commits related to this issue

Most upvoted comments

How to solve it?