Separate out docker dep into package (#482)

This also then removes support for docker-based containing starting (for
now) from platforms other than windows/darwin/linux as there are build
issues on several.
This commit is contained in:
Jeff Mitchell authored and GitHub committed 2020-09-28 16:05:15 -04:00
1 parent fde96924af
commit c1a1f8bb1b
10 files changed
+142 -145

No files matched your search

+5
View File
@@ -9,6 +9,7 @@ import (
"github.com/hashicorp/boundary/internal/auth/password"
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/hashicorp/boundary/internal/cmd/config"
"github.com/hashicorp/boundary/internal/docker"
"github.com/hashicorp/boundary/internal/host/static"
"github.com/hashicorp/boundary/internal/iam"
"github.com/hashicorp/boundary/internal/servers/controller"
@@ -374,6 +375,10 @@ func (c *Command) Run(args []string) int {
opts = append(opts, base.WithSkipDatabaseDestruction())
}
if err := c.CreateDevDatabase("postgres", opts...); err != nil {
if err == docker.ErrDockerUnsupported {
c.UI.Error("Automatically starting a Docker container running Postgres is not currently supported on this platform. Please use -database-url to pass in a URL (or an env var or file reference to a URL) for connecting to an existing empty database.")
return 1
}
c.UI.Error(fmt.Errorf("Error creating dev database container: %w", err).Error())
return 1
}