Friday, 15 June 2012

Why are Docker container images so large? -



Why are Docker container images so large? -

its ridiculous, made simple image through dockerfile fedora (initially 320 mb).

added nano (this tiny editor of 1mb size), size of image risen 530 mb... i've added git on top of that, (30'ish mb), , image size skyrocket 830 mb.

isnt insane?

i've tried export , import container remove history/intermediate images. effort saved 25 mb, image size 804 mb. i've tried run many commands on 1 run, still im getting same initial 830mb.

im having doubts if worth utilize docker @ all. mean come on, barely installed , im hitting 1gb on here. if have add together serious stuff database , on might run out of disk space.

anyone suffers ridiculous size of images? how deal it?

unless dockerfile horribly incorrect?

from fedora:latest maintainer me notyou <email@dot.com> run yum -y install nano run yum -y install git

but hard imagine go wrong in here

as @rexposadas said, images include layers , each layer includes dependencies installed. of import note base of operations images (like fedora:latest tend bare-bones. may surprised number of dependencies installed software has.

i able create installation smaller adding yum -y clean all each line:

from fedora:latest run yum -y install nano; yum -y clean run yum -y install git; yum -y clean

it of import each run, before layer gets committed, or else deletes don't remove data. is, in union/copy-on-write file system, cleaning @ end doesn't cut down file scheme usage because real info committed lower layers. around must clean @ each layer.

$ docker history bf5260c6651d image created created size bf5260c6651d 4 days ago /bin/sh -c yum -y install git; yum -y clean 260.7 mb 172743bd5d60 4 days ago /bin/sh -c yum -y install nano; yum -y clean 12.39 mb 3f2fed40e4b0 2 weeks ago /bin/sh -c #(nop) add together file:cee1a4fcfcd00d18da 372.7 mb fd241224e9cf 2 weeks ago /bin/sh -c #(nop) maintainer lokesh mandvekar 0 b 511136ea3c5a 12 months ago 0 b

docker

No comments:

Post a Comment