Chrome 59からChromeをヘッドレス環境で実行するHeadless Chromeが搭載されました。 自動テスト等でこの機能を使えると便利そうな気がしたので、DockerでHeadless Chrome が使える環境を整えてみます。 Docker Imageの作成 alpine linuxにはgoogle chromeのパッケージはありません。chromeの元となるオープンソース実装のchromiumのpackageを検索してみると、最新版のchromiumが59.0.3071.86-r0と なっています。 これを利用すればHeadlessで動かすことが出来そうなので、今回はこのパッケージを 利用してみました。Branchがedgeとなっていますので、alpine linuxのイメージを edgeのものを使用しました。 $ docker build -t chromium_head