containerd のサイトに Go で containerd を操作するチュートリアルがあったのでやってみました。 containerd.io チュートリアル このチュートリアルでは、Docker Hub にある redis イメージを取得し、コンテナ(タスク)として実行するまでを実装します。 containerd はデーモンとして実行されており、そのクライアントを Go で実装するイメージです。containerd とクライアントは gRPC で通信しますが、このあたりの処理は containerd/containerd パッケージ内で行われるので実装する必要はありません。 サンプルコード Vagrant で Debian 環境を構築して実装しました。Vagrantfile 含め、コードを下記にアップしています。 github.com チュートリアルを試す上では下記が必要となります。