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 has been archived by the owner on May 28, 2022. It is now read-only.
mapfile -t images < <(docker images | awk '{print $1 ":" $2}')
for I in "${images[@]}"; do
echo "--- $I ---"
python dimgx.py "$I"
done
It crashed on the REPOSITORY:TAG line.
It crashed on the <none>:<none> line.
Changed my loop to:
for I in "${images[@]}"; do
if [[ "$I" != "REPOSITORY"* ]] && [[ "$I" != "<none>"* ]]; then
echo "--- $I ---"
python dimgx.py "$I"
fi
done
The crash looked like this:
$ python dimgx.py '<none>:<none>'
Traceback (most recent call last):
File "dimgx.py", line 549, in <module>
_main()
File "D:\Documents\Mine\dimgx\_dimgx\cmd.py", line 268, in main
layers_dict = inspectlayers(dc, args.image)
File "D:\Documents\Mine\dimgx\dimgx.py", line 361, in inspectlayers
raise RuntimeError('{} not found among the layers retreieved for that image'.format(image_spec))
RuntimeError: <none>:<none> not found among the layers retreieved for that image
I realize that the two tests are bad image names, and thus outside the defined behavior of your excellent tool. Just thought you'd want to know about this.
The text was updated successfully, but these errors were encountered:
Thanks! I suppose the RuntimeError isn't the greatest UX for a missing image. I'm actually surprised dimgx is still useful to anyone, though! Also, it's been literally years since I touched docker directly, so don't trust my memory, but I think you can pass an ID instead of a repo:tag pair. So maybe something like the following might work?
( # do this in a subshell, because we're mucking with IFS and we don't want to pollute our current environment
IFS=$'\n' # only split variables on newlines
for line in $( docker images --format '{{.ID}}:{{.Repository}} {{.Tag}}' ) ; do
image_id="${line%%:*}"
image_repo_tag="${line#*:}"
echo "--- ${image_repo_tag} (${image_id}) ---"
python dimgx.py "${image_id}" # assuming I got everything else right, this might work
done
)
If you don't need to print out the repo or tag before calling dimgx.py, you could probably just do:
for image_id in $( docker images --format '{{.ID}}' ) ; do
echo "--- ${image_id} ---"
python dimgx.py "${image_id}"
done
Let me know if any of that helps. I'm curious….
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Out of curiosity, I ran this:
It crashed on the
REPOSITORY:TAG
line.It crashed on the
<none>:<none>
line.Changed my loop to:
The crash looked like this:
I realize that the two tests are bad image names, and thus outside the defined behavior of your excellent tool. Just thought you'd want to know about this.
The text was updated successfully, but these errors were encountered: