Skip to content

Commit

Permalink
Merge pull request #861 from K4sku/update-docker-setup-sample-hook
Browse files Browse the repository at this point in the history
Expand on docker-setup.sample hook
  • Loading branch information
djmb authored Jun 25, 2024
2 parents 22afe4d + 9e12d32 commit 31d6c19
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/kamal/cli/templates/sample_hooks/docker-setup.sample
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/bin/sh
#!/usr/bin/env ruby

# A sample docker-setup hook
#
# Sets up a Docker network which can then be used by the application’s containers
# Sets up a Docker network on defined hosts which can then be used by the application’s containers

ssh [email protected] docker network create kamal
hosts = ENV["KAMAL_HOSTS"].split(",")

hosts.each do |ip|
destination = "root@#{ip}"
puts "Creating a Docker network \"kamal\" on #{destination}"
`ssh #{destination} docker network create kamal`
end

0 comments on commit 31d6c19

Please sign in to comment.