Prune healthcheck containers
If a deployment is interrupted it could leave stale healthcheck containers around that prevent dependent images from being pruned.
This commit is contained in:
@@ -7,8 +7,8 @@ class Kamal::Commands::Healthcheck < Kamal::Commands::Base
|
||||
"--detach",
|
||||
"--name", container_name_with_version,
|
||||
"--publish", "#{exposed_port}:#{config.healthcheck["port"]}",
|
||||
"--label", "service=#{container_name}",
|
||||
"-e", "KAMAL_CONTAINER_NAME=\"#{container_name}\"",
|
||||
"--label", "service=#{config.healthcheck_service}",
|
||||
"-e", "KAMAL_CONTAINER_NAME=\"#{config.healthcheck_service}\"",
|
||||
*web.env_args,
|
||||
*web.health_check_args(cord: false),
|
||||
*config.volume_args,
|
||||
@@ -38,12 +38,8 @@ class Kamal::Commands::Healthcheck < Kamal::Commands::Base
|
||||
end
|
||||
|
||||
private
|
||||
def container_name
|
||||
[ "healthcheck", config.service, config.destination ].compact.join("-")
|
||||
end
|
||||
|
||||
def container_name_with_version
|
||||
"#{container_name}-#{config.version}"
|
||||
"#{config.healthcheck_service}-#{config.version}"
|
||||
end
|
||||
|
||||
def container_id
|
||||
|
||||
Reference in New Issue
Block a user