LoginSignup
54
45

More than 5 years have passed since last update.

Dockerのイメージファイルの格納場所

Posted at

Dockerからhello-worldとdocker/whalesayをpullして、ダウンロードしてきたのですが
一体どこにダウンロードされているんだろうという謎が出てきました。

  • 今あるイメージ
$ docker images 
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
hello-world         latest              0a6ba66e537a        2 weeks ago         960 B
docker/whalesay     latest              ded5e192a685        5 months ago        247 MB
  • 調べてみると、/var/lib/docker 辺りにあるらしい
    http://blog.thoward37.me/articles/where-are-docker-images-stored/

    
    $ sudo cat /var/lib/docker/repositories-aufs | python -mjson.tool
    {
    "Repositories": {
        "docker/whalesay": {
            "latest": "ded5e192a685b2c5f048ea98ca24f4c8c4dccc012185448a0247b49b24645007"
        },
        "hello-world": {
            "latest": "0a6ba66e537a53a5ea94f7c6a99c534c6adb12e3ed09326d4bf3b38f7c3ba4e7"
        }
    }
    }
    
  • サイズも見てみる。それっぽい!

    
    $ sudo du -s /var/lib/docker
    279924  /var/lib/docker
    $ sudo du -sBM /var/lib/docker
    274M    /var/lib/docker
    
54
45
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
54
45