goreleaser/goreleaser · error
%w: %s
Error message
%w: %s
What it means
goreleaser's docker pipe runs external docker (or podman/buildah) CLI commands and wraps a non-zero exit with the command's combined output. This means a docker command invoked to build/create images or manifests failed; the wrapped string contains docker's own error explaining why.
Source
Thrown at internal/pipe/docker/api.go:64
func runCommand(ctx *context.Context, dir, binary string, args ...string) error {
/* #nosec */
cmd := exec.CommandContext(ctx, binary, args...)
cmd.Dir = dir
cmd.Env = append(ctx.Env.Strings(), cmd.Environ()...)
var b bytes.Buffer
w := gio.Safe(&b)
cmd.Stderr = redact.Writer(io.MultiWriter(logext.NewWriter(), w), cmd.Env)
cmd.Stdout = redact.Writer(io.MultiWriter(logext.NewWriter(), w), cmd.Env)
log.
WithField("cmd", append([]string{binary}, args[0])).
WithField("cwd", dir).
WithField("args", args[1:]).
Debug("running")
if err := cmd.Run(); err != nil {
return fmt.Errorf("%w: %s", err, b.String())
}
return nil
}
func runCommandWithOutput(ctx *context.Context, dir, binary string, args ...string) ([]byte, error) {
/* #nosec */
cmd := exec.CommandContext(ctx, binary, args...)
cmd.Dir = dir
cmd.Env = append(ctx.Env.Strings(), cmd.Environ()...)
var b bytes.Buffer
w := gio.Safe(&b)
cmd.Stderr = redact.Writer(io.MultiWriter(logext.NewWriter(), w), cmd.Env)
log.
WithField("cmd", append([]string{binary}, args[0])).
WithField("cwd", dir).
WithField("args", args[1:]).View on GitHub (pinned to f5edd73956)
Solutions
- Read the wrapped docker output in the error — it names the exact docker failure
- Verify the docker daemon is running (`docker info`) in the release environment
- Confirm the Dockerfile path and extra/flags in the docker config are correct
- Reproduce the failing command locally (it's logged at debug level: enable --verbose)
Example fix
// CI before - run: goreleaser release // after - run: docker info # ensure daemon is up - run: goreleaser release
Defensive patterns
Strategy: validation
Validate before calling
if err := exec.Command("docker", "info").Run(); err != nil {
return fmt.Errorf("docker daemon unavailable: %w", err)
}
if _, err := os.Stat(dockerfilePath); err != nil {
return fmt.Errorf("Dockerfile missing: %w", err)
} Try / catch
if err := release(); err != nil && strings.Contains(err.Error(), ": ") {
// error is "<docker err>: <combined output>"; log the tail for the docker reason
} Prevention
- Ensure docker daemon is up in CI before release
- Pin docker/podman binary per build config
- Test builds locally with `goreleaser build --snapshot`
- Keep extra flags compatible with the installed docker version
When it happens
Trigger: runCommand executes a docker binary (build/create/etc.) and cmd.Run() returns non-zero — e.g. Dockerfile missing, build error, docker daemon not running, binary not found in PATH.
Common situations: Dockerfile path or build flags wrong in config; docker daemon not started on CI runner; unsupported flag for the installed docker version; base image pull failure/network issue; using podman with docker-only flags.
Related errors
- failed to generate chocolatey package: %w: %s
- failed to create %s: %w
- no tags provided
- failed to write %s: %w
- invalid ACL %q
AI-assisted analysis of goreleaser/goreleaser@f5edd73956 (2026-09-05).
Data as JSON: /api/errors/0273d8199b535d87.
Report an issue: GitHub.