crawlab-team / crawlab

Distributed web crawler admin platform for spiders management regardless of languages and frameworks. 分布式爬虫管理平台,支持任何语言和框架
https://www.crawlab.cn
BSD 3-Clause "New" or "Revised" License
11.38k stars 1.8k forks source link

Docker镜像构建时注意精简清理 #1525

Closed maoxuner closed 6 days ago

maoxuner commented 6 days ago

Describe the bug 构建临时文件保留在镜像中,导致镜像体积特别大。同样的文件,比如weed在镜像中存在好几份

To Reproduce

$ docker run --rm crawlabteam/crawlab ls /
app
bin
boot
chromedriver_linux64.zip
dev
etc
go1.22.4.linux-amd64.tar.gz
home
lib
lib32
lib64
libx32
linux_amd64.tar.gz
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
weed

以下这些都是构建中的临时文件,镜像各个layer用完相关文件后要及时清理不需要的文件,不能传递到其他layer。可能还有其它多余的文件

Expected behavior 精简的镜像

Screenshots

image

其它建议:

tikazyq commented 6 days ago

addressed in recent commits, e.g. db4dce33a4c4546c22b882af7833e97fe1ebba6c

tikazyq commented 6 days ago

for other issues you mentioned, please submit as separate issues