Skip to content

Commit

Permalink
Add support for hostname
Browse files Browse the repository at this point in the history
Signed-off-by: Julien 'Lta' BALLET <[email protected]>
  • Loading branch information
elthariel committed Jun 7, 2019
1 parent e062a0e commit 80f4d3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions libraries/docker_swarm_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class DockerSwarmService < DockerSwarmBase
property :image, String, required: true
property :user, String, required: true, default: 'root'
property :networks, NonEmptyArray, required: true
property :hostname, String

property :environment, Hash, default: {}
property :log_driver, String, required: true, default: 'json-file'
Expand Down
4 changes: 2 additions & 2 deletions libraries/helpers_swarm_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ def service_container_spec
spec = {
# 'Networks' => [],
'Image' => image,
'User' => user,
'User' => user
# 'Mounts' => [],
}

spec['Env'] = format_env unless environment.empty?
spec['Hostname'] = hostname unless hostname.empty?

spec
end
Expand Down Expand Up @@ -126,7 +127,6 @@ def service_replication_spec
{ 'Replicated' => { 'Replicas' => replicas } }
end
end

def service_endpoint_ports_spec
ports.map do |hash|
{
Expand Down

0 comments on commit 80f4d3e

Please sign in to comment.