Not enough entropy to support /dev/random in docker containers running in boot2docker

前端 未结 6 1803
余生分开走
余生分开走 2020-12-07 13:35

Running out of entropy in virtualized Linux systems seems to be a common problem (e.g. /dev/random Extremely Slow?, Getting linux to buffer /dev/random). Despite of using a

6条回答
  •  Happy的楠姐
    2020-12-07 13:47

    I just realized, that it is simple as mounting /dev/urandom from the host as /dev/random into the container:

    $ docker run -v /dev/urandom:/dev/random ...
    

    The result is as expected:

    $ docker run --rm -it -v /dev/urandom:/dev/random ubuntu dd if=/dev/random of=/dev/null bs=1 count=1024
    1024+0 records in
    1024+0 records out
    1024 bytes (1.0 kB) copied, 0.00223239 s, 459 kB/s
    

    At least I know how to build my own boot2docker images now ;-)

提交回复
热议问题