Dockerは開発が盛んで、バージョンアップも頻繁です。それは喜ばしいのですが、少し前に作られたソフトウェアですらDockerサーバ側とクライアント側のバージョン相違によって動かなくなったりします。 そこで使ってみたいのがDocker Version Managerです。Dockerのバージョン管理システムです。

Docker Version Managerの使い方

Docker Version ManagerはHomebrewなどでインストールできます。インストールしたらまずリモート側の一覧をチェックします。

$ dvm ls-remote
1.8.0
1.8.1
1.8.2
1.8.3
1.9.0
1.9.1
1.10.0
1.10.1
1.10.2
1.10.3
1.11.0
1.11.1
1.11.2

後はインストールコマンドでインストールできます。

$ dvm install 1.11.2
Installing 1.11.2...
Now using Docker 1.11.2

他のバージョン管理ライブラリと同じような使い勝手なので迷わず使えるのではないでしょうか。

$ dvm help
NAME:
   Docker Version Manager - Manage multiple versions of the Docker client

USAGE:
   dvm-helper [global options] command [command options] [arguments...]
   
VERSION:
   0.6.2 (6467884b2e25d080c25aa647bbcbbf8c12dc45bd)
   
COMMANDS:
     install, i              dvm install [<version>], dvm install experimental
                             Install a Docker version, using $DOCKER_VERSION if the version is not specified.
     uninstall               dvm uninstall </version><version>
                             Uninstall a Docker version.
     use                     dvm use [</version><version>], dvm use system, dvm use experimental
                             Use a Docker version, using $DOCKER_VERSION if the version is not specified.
     deactivate              dvm deactivate
                             Undo the effects of `dvm` on current shell.
     current                 dvm current
                             Print the current Docker version.
     which                   dvm which
                             Print the path to the current Docker version.
     alias                   dvm alias <alias> <version>
                             Create an alias to a Docker version.
     unalias                 dvm unalias <alias>
                             Remove a Docker version alias.
     list, ls                dvm list [<pattern>]
                             List installed Docker versions.
     list-remote, ls-remote  dvm list-remote [</pattern><pattern>]
                             List available Docker versions.
     list-alias, ls-alias    dvm list-alias
                             List Docker version aliases.

GLOBAL OPTIONS:
   --github-token value  Increase the github api rate limit by specifying your github personal access token. [$GITHUB_TOKEN]
   --dvm-dir value       Specify an alternate DVM home directory, defaults to ~/.dvm. [$DVM_DIR]
   --shell value         Specify the shell format in which environment variables should be output, e.g. powershell, cmd or sh/bash. Defaults to sh/bash. [$SHELL]
   --debug               Print additional debug information.
   --silent              Suppress output. Errors will still be displayed. [$DVM_SILENT]
   --help, -h            show help
   --version, -v         print the version

Dockerのバージョン違いによって動かないといったことがよくあるので便利に使えると思います。ただし最近の1.12系はインストールできなかったのが残念です。最新版(開発版含め)をどんどん追従していってくれると便利になるでしょう。

dvmはBash/PowerShell製のオープンソース・ソフトウェア(Apache Licnese 2.0)です。

getcarina/dvm: Docker Version Manager