最近はローカルの環境をいかに汚さずに保てるかが注目されています。ローカルを汚さないと言うことはポータブルであり、さらに仮想化されていればホストOSに依存せずに機能が使えます。 macOSで使われるHomebrewは便利なライブラリインストーラーですが、環境を汚してしまうのが難点です。そこで使ってみたいのがwhalebrew、Dockerを使ったHomebrew風パッケージ管理システムです。

whalebrewの使い方

whalebrewコマンドを使って操作します。searchオプションで一覧が出ます。

$ whalebrew search
whalebrew/ab
whalebrew/ack
  :
whalebrew/whalesay
whalebrew/youtube-dl

後はinstallオプションでパッケージをインストールできます。

$ whalebrew install whalebrew/mercurial
Unable to find image 'whalebrew/mercurial' locally
Using default tag: latest
latest: Pulling from whalebrew/mercurial
0a8490d0dfd3: Pull complete 
c50b8fc3bdf8: Pull complete 
Digest: sha256:93f9ab1fcdd11f6920515dc45b6e088f86b2c92e0e468c880439b3a6fdc6b8a7
Status: Downloaded newer image for whalebrew/mercurial:latest
?  Installed whalebrew/mercurial to /usr/local/bin/hg

whalebrewの特徴は/usr/local/bin以下にコマンドを配置してくれるので、普通のローカルにあるコマンドと同じように使えるということです。素のローカルコマンドに比べると若干遅いかも知れませんが、可搬性が高いのは魅力です。また、インストールサイズは若干大きくなってしまうのは否めないでしょう。

whalebrewはmacOS用のオープンソース・ソフトウェア(Apache Licnese 2.0)です。

bfirsh/whalebrew: Homebrew, but with Docker images