Skip to content

UUID generation in implicit init() causes issues if no /dev/urandom is available #782

@ibuildthecloud

Description

@ibuildthecloud

At https://github.com/docker/distribution/blob/b6ec2f2b1096d644be5602a253bb607ee9240c04/context/context.go#L30 a UUID is generated and that requires /dev/urandom.

I'm writing some code that runs in a context in which /dev/urandom does not exist. I don't use the distribution code but I use Docker code that has a transitive dependency on this code. Since /dev/urandom doesn't exist my program panics now even though I don't use the distribution code. Is it possible to generate this UUID on demand or lazy initialize so that its not in the init() of the package?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions