Docker login if exec might pull image

The `app exec` and `accessory exec` commands will run `docker run` if
they are not set to reuse existing containers. This might need to pull
an image so let's make sure we are logged in before running the command.

Fixes: https://github.com/basecamp/kamal/issues/1163
This commit is contained in:
Donal McBreen
2025-04-18 14:44:43 +01:00
parent cd9d01b016
commit 7a63cacb09
4 changed files with 8 additions and 0 deletions

View File

@@ -115,6 +115,7 @@ class CliAccessoryTest < CliTestCase
test "exec" do
run_command("exec", "mysql", "mysql -v").tap do |output|
assert_match "docker login private.registry -u [REDACTED] -p [REDACTED]", output
assert_match "Launching command from new container", output
assert_match "mysql -v", output
end