Does the docker image size changes after push

355 views
Skip to first unread message

nibedit...@gmail.com

unread,
May 7, 2019, 11:43:15 AM5/7/19
to Nexus Users
Hi Team,

I have pushed 2 docker images of 26GB(total 52 GB) . When i check the disk usage of the repository. It shows 19GB. 
When i try to run the curl command to check the blob store usage it shows 20+GB.
If i understand correctly the images are compressed after push. Please let me know if my understanding is correct or not.
I am using NXRM 3.15.0-02

Regards
Nibedita

Peter Lynch

unread,
May 7, 2019, 12:55:54 PM5/7/19
to Nibedita Nanda, Nexus Users
On Tue, May 7, 2019 at 12:43 PM <nibedit...@gmail.com> wrote:
Hi Team,

I have pushed 2 docker images of 26GB(total 52 GB) .

How exactly did you determine this size?
 
When i check the disk usage of the repository. It shows 19GB. 
When i try to run the curl command to check the blob store usage it shows 20+GB.
If i understand correctly the images are compressed after push. Please let me know if my understanding is correct or not.

Docker images consist of layers ( parts) . A layer may be re-used by multiple images by way of the manifest describing what is in that image. For a given repository, NXRM will only store a layer once, even if referenced by multiple images. So to use the procedure you describe to check disk usage on the server is not appropriate.

I am using NXRM 3.15.0-02

Regards
Nibedita

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/6d5ad194-73df-424c-b49a-1920dc157a37%40glists.sonatype.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.


--
Sonatype
Peter Lynch
Senior Product Support Engineer

nibedit...@gmail.com

unread,
May 7, 2019, 2:19:26 PM5/7/19
to Nexus Users
Ex i have 2 images locally when i give docker images it shows the exact size of the image and that is how it shows 26GB per image

When i check the blob store at GUI it shows the total size used by the repository which is equivalent to the blob store size(i check by du -sh> under <data-dir>/blobs/<repository>
I can see an API which gives the disk usage of a particular repository if i run below command.

curl -u admin:passcode -X GET "<localhost>:post/service/rest/v1/blobstores/repo-name/quota-status" -H "accept: application/json"

Do you say this is not the way we should check the disk usage?
Then what is the best way to check the disk usage.

Manfred Moser

unread,
May 7, 2019, 11:27:05 PM5/7/19
to nexus...@glists.sonatype.com, nibedit...@gmail.com

Thats not how docker images work. The are composed of layers and those layers are shared between images.. that is the case locally as well as on the repo manager. 


E.g. you have two containers 

A with centos 6 and an app - 800MB

B with centos6 and a different app - 850 MB

If the centos6 layer is say 750 MB on the repo manager the two containers would add up to

750 + 50 from A + 100 from B = 900 MB ... NOT 1650 MB

Not in reality there are LOTS of layers involved so its more complicated but you get the idea.

Overall I would suggest to learn more about Docker ... 

manfred
simpligility.com

And btw... 26GB container size is terrible. The smaller the better. If your containers are that large I am sure you are doing something else wrong.

Reply all
Reply to author
Forward
0 new messages