2017-04-11 8 views
0

Ubuntu 14.04のドッカーイメージは、サイズが大きく、lsb_releaseコマンドを持っています。Ubuntuの2つのDocker画像の違いを調べるにはどうすればよいですか?

$ docker run -it ubuntu:14.04 
[email protected]:/# lsb_release -a 
No LSB modules are available. 
Distributor ID: Ubuntu 
Description: Ubuntu 14.04.5 LTS 
Release: 14.04 
Codename: trusty 
[email protected]:/# exit 
exit 
$ docker images ubuntu:14.04 
REPOSITORY   TAG     IMAGE ID   CREATED    SIZE 
ubuntu    14.04    7c09e61e9035  6 weeks ago   188 MB 

のUbuntu 16.04のドッカー画像は、サイズが小さく、 lsb_releaseコマンドを持っていません。

$ docker run -it ubuntu:16.04 
[email protected]:/# lsb_release -a 
bash: lsb_release: command not found 
[email protected]:/# exit 
exit 
$ docker images ubuntu:16.04 
REPOSITORY   TAG     IMAGE ID   CREATED    SIZE 
ubuntu    16.04    0ef2e08ed3fa  6 weeks ago   130 MB 

これらのDockerfilesから、どのようにしてこの違いが生じるのでしょうか。

+0

あなたの本当の実際の問題は、解決策は、パッケージ[ 'LSB-release'](http://packages.ubuntu.com/xenial/lsb-をinsstallすることで、「私はそれについて何ができる」である場合、リリース) – tripleee

答えて

3

ここに、両方の画像のDockerfilesがあります。

14.04のための

ここでは、これら2つのファイル間の唯一の違いです。

-ADD ubuntu-trusty-core-cloudimg-amd64-root.tar.gz/
+ADD ubuntu-xenial-core-cloudimg-amd64-root.tar.gz/

は、だから今、私たちはxenialに

  • https://github.com/tianon/docker-brew-ubuntu-core/blob/1a5cb40f41ac4829d8c301ccd2cf3b7a13687a8b/trusty/ubuntu-trusty-core-cloudimg-amd64-root.tar.gz
  • 実際lsb_release頼りに含まれているではないから、両方には.tar.gzファイルをダウンロードしてください。

    $ tar -tf ubuntu-trusty-core-cloudimg-amd64-root.tar.gz | grep lsb_release$ 
    usr/bin/lsb_release 
    $ tar -tf ubuntu-xenial-core-cloudimg-amd64-root.tar.gz | grep lsb_release$ 
    $ 
    

    次に、両方のtarballの内容をディレクトリに抽出すると、trustyがxenialより大きいかどうかを確認できます。

    $ mkdir trusty xenial 
    $ tar -xf ubuntu-trusty-core-cloudimg-amd64-root.tar.gz -C trusty 
    $ tar -xf ubuntu-xenial-core-cloudimg-amd64-root.tar.gz -C xenial 
    $ du -sh trusty xenial 
    208M trusty 
    141M xenial 
    
    関連する問題