やったこと docker clientをGoのコードからimportする container作成 container起動 container停止(& 自動削除) 苦労したこと けっこうdocker(現moby)のコードの移り変わりが激しくて、vendorを固定するのが苦労した これとか できなかったこと コードからのimage pull コードからのimage save それを元に上記を実行 【追記】できた GoのコードからDockerイメージのpullを実装する(bufio.Scannerかわいい) - DRYな備忘録 main.go package main import ( "context" "fmt" "time" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container"
![GoのコードからDockerコンテナの起動を実装する - DRYな備忘録](https://cdn-ak-scissors.b.st-hatena.com/image/square/88aaaafade0f74daabf0734a6d16444a1eb35776/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fo%2Fotiai10%2F20170524%2F20170524163022.png)