when I execute docker images I have below docker images
as list where there are images with multiple tag and also image with latest tag value.
REPOSITORY TAG IMAGE ID CREATED SIZE
m1 latest 40febdb010b1 15 minutes ago 479MB
m2 130 fab5a122127a 4 weeks ago 2.74GB
m2 115 5a2ee5c5f5e5 4 weeks ago 818MB
m3 111 dd91a7f68e3d 5 weeks ago 818MB
m3 23 0657662756f6 5 weeks ago 2.22GB
m4 23 0657662756f6 5 weeks ago 2.22GB
While I do for i in {docker image save -o <imagename>.tar}
I would like to only save the images as tar for the tag with higher numbers but except any docker image with latest
tag and docker image name as m4
How this can be achieved in one liner command.