fix: print docker output in network error and use networkName constant

The network creation error format string had a trailing "output" with no
verb, silently dropping the captured docker output. Add the missing %s.
Also replace the hardcoded "app-dono_app" literal with the networkName
constant in RunAppClienteContainer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
jb
2026-06-19 11:54:02 -03:00
co-authored by Claude Opus 4.8
parent 25137eb5da
commit 3379ada59a
+2 -2
View File
@@ -56,7 +56,7 @@ func EnsureNetwork(name string) error {
cmd = exec.Command("docker", "network", "create", name) cmd = exec.Command("docker", "network", "create", name)
out, err := cmd.CombinedOutput() out, err := cmd.CombinedOutput()
if err != nil { if err != nil {
return fmt.Errorf("erro ao criar network %s: %w\noutput", name, err, string(out)) return fmt.Errorf("erro ao criar network %s: %w\noutput: %s", name, err, string(out))
} }
return nil return nil
} }
@@ -125,7 +125,7 @@ func RunAppClienteContainer(image, containerName, configPath, configDestinationP
"-u", uidGid, "-u", uidGid,
"-p", fmt.Sprintf("%s:8080", cv.Server["port"]), "-p", fmt.Sprintf("%s:8080", cv.Server["port"]),
"--name", containerName, "--name", containerName,
"--network", "app-dono_app", "--network", networkName,
"--restart", "unless-stopped", "--restart", "unless-stopped",
"-v", fmt.Sprintf("%s:%s", absPath, configDestinationPath), "-v", fmt.Sprintf("%s:%s", absPath, configDestinationPath),
"-v", fmt.Sprintf("%s:/app/certs", cv.Cert["cert_dir_path"]), "-v", fmt.Sprintf("%s:/app/certs", cv.Cert["cert_dir_path"]),