Add container name env var for containers
Because the container name is generated it isn't possible to determine this inside the container. This adds the MRSK_CONTAINER_NAME env var when running the container so it can be read by the service running inside the container.
This commit is contained in:
@@ -7,6 +7,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
||||
"--restart unless-stopped",
|
||||
"--log-opt", "max-size=#{MAX_LOG_SIZE}",
|
||||
"--name", service_with_version_and_destination,
|
||||
"-e", "MRSK_CONTAINER_NAME=\"#{service_with_version_and_destination}\"",
|
||||
*role.env_args,
|
||||
*config.volume_args,
|
||||
*role.label_args,
|
||||
|
||||
@@ -9,6 +9,7 @@ class Mrsk::Commands::Healthcheck < Mrsk::Commands::Base
|
||||
"--name", container_name_with_version,
|
||||
"--publish", "#{EXPOSED_PORT}:#{config.healthcheck["port"]}",
|
||||
"--label", "service=#{container_name}",
|
||||
"-e", "MRSK_CONTAINER_NAME=\"#{container_name}\"",
|
||||
*web.env_args,
|
||||
*config.volume_args,
|
||||
config.absolute_image,
|
||||
|
||||
Reference in New Issue
Block a user