私はドッカーと一緒に作業しており、ubuntuイメージの最上部にあるzipファイルにアプリケーションをインストールすることで最小限の新しいレイヤーを作成したいと考えています。 Ubuntuのイメージはどちらもwgetコマンドを持っていたりインストール解凍したので、私は新しいドッキングウィンドウ層のコンテンツのみが可能ならば、それはいいだろう、この時点でapt-get update
最初undo apt-get update(ドッカーコンテナー内)
docker run -it --name app_container ubuntu:latest
# now i have terminal access to the fresh app_container
# install wget and unzip
apt-get update
apt-get install wget -y
apt-get install unzip -y
# download and unpack the app
# ...
# remove wget and unzip
apt-get purge unzip
apt-get purge wget
# i need to remove some dependencies of wget that are no longer needed
apt-get autoremove
を必要とするapt-getをを使用することによって、それらのインストール新しいアプリケーションですが、依然としてapt-get update
によって作成/更新されたファイルがあります。私は
apt-get clean
を使用することによって、それらのを削除しようとしたが、
docker diff app_container
は、(アプリに所属していなかった)左の変更されたファイルの存在場所がたくさんあることを明らかにしました。これらのファイルは無視できるサイズです(主に/etc/ssl
と/var/lib/dpkg/info
の残存wget証明書と23MBのアーカイブファイルが/var/lib/app/lists
)が、最もクリーンなドッキング層の精神を持っています。それらを削除するスマートな方法はありますか? apt-getを持つ[最小化ドッカー画像:(「スマート」ブルートフォースするRMを頼らず意味する)
関連するすべてのものを削除するよりも良いの提案はなさそうですbuild deps](http://stackoverflow.com/q/28967591/418413) – kojiro
'apt-get install --no-install-recommends'と一緒にインストールしようとします – user2915097
- ドッキング・イメージのリンクを最小にすると、/ var/lib/app/listsのように表示されます。 – StephanS