Skip to content

Commit

Permalink
Make sure we have a db image before running it (#1058)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed Aug 16, 2018
1 parent f9acd24 commit 18436c8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/dockerutil/dockerutils.go
Expand Up @@ -412,6 +412,12 @@ func GetDockerIP() (string, error) {
// Example code from https://gist.github.com/fsouza/b0bf3043827f8e39c4589e88cec067d8
func RunSimpleContainer(image string, name string, cmd []string, entrypoint []string, env []string, binds []string, uid string) (string, error) {
client := GetDockerClient()
var buf bytes.Buffer
err := client.PullImage(docker.PullImageOptions{Repository: image, OutputStream: &buf},
docker.AuthConfiguration{})
if err != nil {
return "", fmt.Errorf("failed to pull image %s: %v", image, err)
}

// Windows 10 Docker toolbox won't handle a bind mount like C:\..., so must convert to /c/...
for i := range binds {
Expand Down

0 comments on commit 18436c8

Please sign in to comment.