Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F29435391
raw.txt
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
thcipriani
Jun 10 2019, 7:01 PM
2019-06-10 19:01:30 (UTC+0)
Size
520 B
Referenced Files
None
Subscribers
None
raw.txt
View Options
#!/usr/bin/env python
#
# Finds all docker images without the latest tag
#
# Use like:
# python not-latest-docker.py | while read img; do docker rmi "$img"; done
import subprocess
images = {}
for thing in subprocess.check_output('docker image ls --format "{{.ID}} {{.Tag}}"', shell=True).splitlines():
image, tag = thing.split(' ')
if not images.get(image):
images[image] = []
images[image].append(tag)
for image, tags in images.items():
if 'latest' in tags:
continue
print image
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
7610200
Default Alt Text
raw.txt (520 B)
Attached To
Mode
P8604 not-latest-docker.py
Attached
Detach File
Event Timeline
Log In to Comment