Created
October 7, 2020 19:57
-
-
Save angrycub/61fe9292e9d64033f584be0066f2e8cc to your computer and use it in GitHub Desktop.
Using the mac_address configuration for a Docker task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job "example" { | |
datacenters = ["dc1"] | |
group "cache" { | |
task "redis" { | |
driver = "docker" | |
config { | |
image = "redis:3.2" | |
mac_address = "A0:97:FA:13:93:03" | |
port_map { | |
db = 6379 | |
} | |
} | |
resources { | |
cpu = 500 | |
memory = 256 | |
network { | |
mbits = 10 | |
port "db" {} | |
} | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15:49 # nomad run example.nomad | |
==> Monitoring evaluation "42672dec" | |
Evaluation triggered by job "example" | |
Evaluation within deployment: "27ed52bd" | |
Allocation "1c2461a9" created: node "023f7896", group "cache" | |
Evaluation status changed: "pending" -> "complete" | |
==> Evaluation "42672dec" finished with status "complete" | |
15:49 # nomad alloc exec 1c2 cat /sys/class/net/eth0/address | |
a0:97:fa:13:93:03 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment