Quirky Container Names
If you work with docker containers, you would have noticed the quirky names that docker generates for your containers. Ever wondered how they are generated?
Let me unravel this mystery for you today.
This is how the autogenerated container names look like :-
These names are generated via the code here.
It picks random entries in arrays left and right and combines them. Array left has adjectives and right has names of notable scientists and hackers.
rnd := random.Rand
...
name := fmt.Sprintf("%s_%s", left[rnd.Intn(len(left))], right[rnd.Intn(len(right))])
Of course, no code which generates such quirky names would be devoid of attitude.
if name == "boring_wozniak" /* Steve Wozniak is not boring */ {
goto begin
}
That’s all there is to it!
Next time, you need to autogenerate strings for your particular piece of software, you know where to look for inspiration :)