Merge branch 'main' into dockerfile-context-build-options
This commit is contained in:
@@ -2,7 +2,7 @@ class Mrsk::Commands::Registry < Mrsk::Commands::Base
|
||||
delegate :registry, to: :config
|
||||
|
||||
def login
|
||||
docker :login, registry["server"], "-u", redact(registry["username"]), "-p", redact(lookup_password)
|
||||
docker :login, registry["server"], "-u", redact(lookup("username")), "-p", redact(lookup("password"))
|
||||
end
|
||||
|
||||
def logout
|
||||
@@ -10,11 +10,11 @@ class Mrsk::Commands::Registry < Mrsk::Commands::Base
|
||||
end
|
||||
|
||||
private
|
||||
def lookup_password
|
||||
if registry["password"].is_a?(Array)
|
||||
ENV.fetch(registry["password"].first).dup
|
||||
def lookup(key)
|
||||
if registry[key].is_a?(Array)
|
||||
ENV.fetch(registry[key].first).dup
|
||||
else
|
||||
registry["password"]
|
||||
registry[key]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ class Mrsk::Commands::Traefik < Mrsk::Commands::Base
|
||||
"--detach",
|
||||
"--restart", "unless-stopped",
|
||||
"--log-opt", "max-size=#{MAX_LOG_SIZE}",
|
||||
"--publish", "80:80",
|
||||
"--publish", port,
|
||||
"--volume", "/var/run/docker.sock:/var/run/docker.sock",
|
||||
"traefik",
|
||||
"--providers.docker",
|
||||
@@ -45,6 +45,10 @@ class Mrsk::Commands::Traefik < Mrsk::Commands::Base
|
||||
docker :image, :prune, "--all", "--force", "--filter", "label=org.opencontainers.image.title=Traefik"
|
||||
end
|
||||
|
||||
def port
|
||||
"#{config.raw_config.traefik.fetch("host_port", "80")}:80"
|
||||
end
|
||||
|
||||
private
|
||||
def cmd_args
|
||||
(config.raw_config.dig(:traefik, "args") || { }).collect { |(key, value)| [ "--#{key}", value ] }.flatten
|
||||
|
||||
Reference in New Issue
Block a user