You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 23, 2018. It is now read-only.
While collapsing multiple progress messages into one output line works well when the ID doesn't change, Docker sometimes sends interleaving progress messages for different image IDs (which rocker happily prints, one per line).
Example: Create an elasticsearch.rocker file:
{"image": "elasticsearch"}
and run rocker run elasticsearch (assuming the respective images haven't been pulled yet).
That will create roughly 100 progress lines for only ~10 different image layers.
As one can see the IDs repeat but the output lines aren't collapsed properly.
One possible implementation:
Keep a dict of {"id": <offset>} containing the order in which we saw each image ID (and therefore having len(dict) - dict[id] being the number of lines to go back)
Every time we see a new ID, add a new output line and an entry to the dict
When we see an ID we've encountered before, we calculate how many lines to go back and reuse that output line
When messages without an ID arrive, reset the dict