14

Dockers JSON output is garbage.

First, you'll get no JSON per se.

You get a JSON string per image, Like this:

{...} LF
{...} LF
{...} LF

Then I tried to parse the labels.

It looked easy: <Key>=<Value> , delimited by comma.

Lil oneliner... Boom.

Turns out that Docker allows comma in the value line and doesn't escape it.

Great.

One liner turns into char by char parser to properly tokenize the Labels based on the last known delimiter.

I thought that this was a 5 min task.

Guess what, Docker sucks and this has turned into try and error...

For fucks sake, I hated Docker before, but this makes me more angry than anything else. Properly returning an parseable API isn't that hard :@

Comments
  • 2
    Good material.
    Needs more anger.
  • 1
    @Root Nope.

    I just swallowed my pride and let the motherfucking cunts of profound dumbness win.

    Thanks to the magnitude of fuckery it seems that there is no _sane_ way to extract from a console output all necessary values without risk.

    I now fetch the result of inspect (previous PS) and get _everything_.

    At least here I get a JSON result - just per containerId not for all containers.

    It explains why docker is dead I guess.

    Solving problems by fetching tons of MB per container vs one list for whole context is just... Brain damaged.

    May docker die a miserable death.

    I'm solving the speed issues by ASYNC and brute force.

    I need infos of more than 200 containers... I'll cache them on disk and be done with this shit.

    Without async it would take hours to get the informations.
  • 0
    Finally....

    nicely generated zone files for Bind and Haproxy listen directives for reverse proxying....
Add Comment