Boxイメージの更新チェック

Vagrantにおいて表題の件をやるコマンドっぽいのがあったので確認。前からあっただろうか?

■ 環境

  • Vagrant 1.8.1
  • Mac OSX El Capitan

■ box outdated

下記コマンドがあることにhelpを見ていて気がついた。

$ vagrant box outdated

実際に試してみる。

$ vagrant box outdated
A Vagrant environment or target machine is required to run this
command. Run `vagrant init` to create a new Vagrant environment. Or,
get an ID of a target machine from `vagrant global-status` to run
this command on. A final option is to change to a directory with a
Vagrantfile and to try again.
$

どうやら”Vagrantfile“があるディレクトリで実行するか、IDを指定する必要があるらしい。”CentOS/7“のBoxイメージを使用しているVMで試してみると下記のように出力された。

$ cd ~/work/project/...
$ ls
Vagrantfile
$ vagrant box outdated
Checking if box 'centos/7' is up to date...
A newer version of the box 'centos/7' is available! You currently
have version '1602.02'. The latest is version '1603.01'. Run
`vagrant box update` to update.
$

どうやら新しいversionが存在するようだ。現在のversionを確認して`update`を実行してみる。

$ vagrant box list
centos/7           (virtualbox, 1602.02)
centos/atomic-host (virtualbox, 7.20151101)
ubuntu/vivid64     (virtualbox, 20160128.0.0)
$
$ vagrant box update
==> Checking for updates to 'centos/7'
    Latest installed version: 1602.02
    Version constraints:
    Provider: virtualbox
==> Updating 'centos/7' with provider 'virtualbox' from version
==> '1602.02' to '1603.01'...
==> Loading metadata for box 'https://atlas.hashicorp.com/centos/7'
==> Adding box 'centos/7' (v1603.01) for provider: virtualbox
    Downloading: https://atlas.hashicorp.com/centos/boxes/7/versions/1603.01/providers/virtualbox.box
==> Successfully added box 'centos/7' (v1603.01) for 'virtualbox'!
$
$ vagrant box list
centos/7           (virtualbox, 1602.02)
centos/7           (virtualbox, 1603.01)
centos/atomic-host (virtualbox, 7.20151101)
ubuntu/vivid64     (virtualbox, 20160128.0.0)
$

updateされたようである。古いversionは不要になったら個別に削除。

以上。

■ 関連

コメントを残す

メールアドレスが公開されることはありません。

CAPTCHA


このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください