我使用Sonatype Nexus作为Docker Registry,过了一段时间,它变得非常大(每个CI版本和一些旧项目的新图像)。
我尝试使用"清除未使用的码头清单和图像"任务,但它似乎没有做任何事情。
答案 0 :(得分:0)
创建清洁策略(例如:修改后15天)
-注意:docker push
的相同哈希值是 not 修改
对于您的每个注册表(Nexus称其为“ Docker类型的存储库”):
答案 1 :(得分:0)
我手动删除了旧的docker镜像。
获取nexus-cli
wget https://s3.eu-west-2.amazonaws.com/nexus-cli/1.0.0-beta/linux/nexus-cli
chmod + x nexus-cli
配置主机
./ nexus-cli configure
显示图片
./ nexus-cli image ls
保留最新的5张图片
./ nexus-cli图片删除-name mlabouardy / nginx -keep 5
干净的脚本
image_file=image.txt CLI_HOME=/data/nexus3 KEEP_VERSION_NUM=5 $CLI_HOME/nexus-cli image ls > $image_file sed -i '$d' $image_file cat $image_file | while read line do echo "start clean image: $line" $CLI_HOME/nexus-cli image delete -name $line -keep $KEEP_VERSION_NUM done
创建创建docker-删除未使用的清单和图像任务
创建创建管理员-紧凑型Blob存储任务
答案 2 :(得分:0)
答案 3 :(得分:-2)
尝试运行"清除未使用的泊坞窗清单和图像"任务。
答案 4 :(得分:-4)
要删除旧的和/未使用的泊坞窗图像,必须使用以下命令:
import kivy
kivy.require('1.9.0')
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.popup import Popup
from kivy.lang import Builder
Builder.load_string('''
<popuptest>:
# POPUP test
size_hint: .8, .47
auto_dismiss: False
title: "Popup Test"
BoxLayout:
orientation: "vertical"
padding: 40
spacing: 40
Button:
text: "Print to console"
height: 40
width: 130
size_hint: (None, None)
pos_hint: {'center_x': 0.5}
on_press: root.printMe()
Label:
text: " "
Button:
text: "Close"
height: 40
width: 80
size_hint: (None, None)
pos_hint: {'center_x': 0.5}
on_release: root.dismiss()
<mgsApp>:
canvas:
Color:
rgba: .200, .235, .235, 1
Rectangle:
pos: self.pos
size: self.size
orientation: "vertical"
ActionBar:
ActionView:
use_seperator: True
ActionPrevious:
title: "Test App"
with_previous: False
ActionButton:
text: "Print to console"
on_press: root.itemHandler()
ActionButton:
text: "Open Popup"
on_release: root.openPopup()
Label:
text: ' '
text_size: self.size
''')
class popuptest(Popup):
def printMe(self):
#This should cause too much iteration!
printing = mgsApp()
printing.itemHandler()
class mgsApp(BoxLayout):
def itemHandler(self):
#print to the console
print "Testing 123"
def openPopup(self):
popupWindow = popuptest()
popupWindow.open()
class mgsAppApp(App):
def build(self):
self.main_screen = mgsApp()
return self.main_screen
if __name__ == '__main__':
mgsAppApp().run()
文件:https://docs.docker.com/engine/reference/commandline/image_prune/