LoginSignup
2
2

More than 5 years have passed since last update.

Dockerでいい感じのDebianのイメージが欲しい 最新

Last updated at Posted at 2014-04-13

Dockerでいい感じのDebianのイメージが欲しい - Qiita

以前に書いたこの記事ですが,このスクリプトは既にサポートされなくなったスクリプトを元に作っています

現在サポートされているものは docker/contrib/mkimage-debootstrap.sh at master · dotcloud/docker とのことです

Debian 以外の debootstrap が使えるディストリビューションに対応しているようです

使い方は以下のようにします

LANG=C ./mkimage-debootstrap.sh wheezy -i sudo,subversion,git,build-essential,openssh-server catatsuy/wheezy http://ftp.jp.debian.org/debian

LANG=C は必須ではないです

こうすれば sudo,git,subversion,build-essential,openssh-server があらかじめインストールされているイメージが作られて catatsuy/wheezy という名前で登録されます

しかしデフォルトでは --variant=minbase が指定されているために普通の Debian には入っているパッケージなどが入っていなかったりします

そこで debootstrap--variant の指定を削除します
またデフォルトでは include は iproute,iputils-ping が指定されていますが,--variant を外せば標準でインストールされるので指定しなくても構いません

イメージをファイルで欲しい

LANG=C ./mkimage-debootstrap.sh -i sudo,subversion,git,build-essential,openssh-server -t cawheezy.tar wheezy http://ftp.jp.debian.org/debian

のようにするとtar ballにしてくれます

このファイルをインポートするには以下のようにします

cat cawheezy.tar | docker import - catatsuy/wheezy

イメージの形式は .tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz に対応しているとのことなので,圧縮率の高い xz などで圧縮しておくのがおすすめです

2
2
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
2
2