diff --git a/Dockerfile b/Dockerfile index 31a9ee6..b624d9d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ -FROM golang:1.9-alpine +FROM golang:1.10-alpine RUN apk add --no-cache \ ca-certificates \ + curl \ git \ gcc \ libffi-dev \ @@ -12,8 +13,8 @@ RUN apk add --no-cache \ ruby-dev \ tar -RUN go get -u github.com/golang/dep/... \ - && go get -u github.com/alecthomas/gometalinter \ +RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh +RUN go get -u github.com/alecthomas/gometalinter \ && go get -u github.com/goreleaser/goreleaser RUN gometalinter --install --update diff --git a/Gopkg.lock b/Gopkg.lock index 7045d6c..427548f 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -11,19 +11,19 @@ branch = "master" name = "github.com/deckarep/gosx-notifier" packages = ["."] - revision = "61a88900fb062ed8c63828adf4d7b58463b61f78" + revision = "e127226297fb751aa3b582db5e92361fcbfc5a6c" [[projects]] name = "github.com/fatih/color" packages = ["."] - revision = "570b54cabe6b8eb0bc2dfce68d964677d63b5260" - version = "v1.5.0" + revision = "507f6050b8568533fb3f5504de8e5205fa62a114" + version = "v1.6.0" [[projects]] branch = "master" name = "github.com/hashicorp/go-version" packages = ["."] - revision = "fc61389e27c71d120f87031ca8c88a3428f372dd" + revision = "4fe82ae3040f80a03d04d2cccb5606a626b8e1ee" [[projects]] branch = "master" @@ -35,7 +35,7 @@ branch = "master" name = "github.com/martinlindhe/notify" packages = ["."] - revision = "369b9400397a805575ad39e97cc4e7d493ea4335" + revision = "5013fd17b38d0637ca75445b55c892ab70f3e17d" [[projects]] name = "github.com/mattn/go-colorable" @@ -71,7 +71,7 @@ branch = "master" name = "golang.org/x/sys" packages = ["unix"] - revision = "92ac112afc6efd90284acda2b046fc0e351228f6" + revision = "f6cff0780e542efa0c8e864dc8fa522808f6a598" [[projects]] branch = "v1" @@ -80,10 +80,10 @@ revision = "b700e246b8b6d3e13554091e540e1019e26389f1" [[projects]] - branch = "v2" name = "gopkg.in/yaml.v2" packages = ["."] - revision = "eb3733d160e74a9c7e442f435eb3bea458e1d19f" + revision = "7f97868eec74b32b0982dd158a51a446d1da7eb5" + version = "v2.1.1" [solve-meta] analyzer-name = "dep" diff --git a/commands/prune.go b/commands/prune.go index 9cc5b3e..0624da6 100644 --- a/commands/prune.go +++ b/commands/prune.go @@ -26,11 +26,17 @@ func (cmd *Prune) Commands() []cli.Command { // Run executes the `rig prune` command func (cmd *Prune) Run(c *cli.Context) error { - cmd.out.Spin("Cleaning up unused Docker resources...") - /* #nosec */ - if exitCode := util.PassthruCommand(exec.Command("docker", "system", "prune", "--all", "--volumes")); exitCode != 0 { - return cmd.Failure("Failure pruning Docker resources.", "COMMAND-ERROR", 13) + + if util.AskYesNo("Are you sure you want to remove all unused containers, networks, images, caches, and volumes?") { + cmd.out.Info("Cleaning up unused Docker resources. This may take a while...") + /* #nosec */ + if exitCode := util.PassthruCommand(exec.Command("docker", "system", "prune", "--all", "--volumes", "--force")); exitCode != 0 { + return cmd.Failure("Failure pruning Docker resources.", "COMMAND-ERROR", 13) + } + cmd.out.Info("Unused Docker images, containers, volumes, and networks cleaned up.") + } else { + cmd.out.Warn("Cleanup aborted.") } - cmd.out.Info("Unused Docker images, containers, volumes, and networks cleaned up.") + return cmd.Success("") } diff --git a/docker-compose.yml b/docker-compose.yml index 2e7eb9a..bc72d6e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,7 +13,7 @@ services: # Lint the codebase lint: extends: base - entrypoint: [ "gometalinter", "--vendor", "--config=gometalinter.json"] + entrypoint: [ "gometalinter", "--vendor", "--config=gometalinter.json", "--deadline=60s"] command: "./..." # Build rig, dropping off a working binary in build/darwin/rig.