Dev Environment
NOTE: -network-interface=en0
is required when using Docker Desktop (e.g. on Mac or Windows) so that networking between tasks work.
- Create a cluster - Nomad Tutorial
- How to connect to my host network when using Docker Desktop (Windows and MacOS) - Nomad Docs
With Configuration File
MacOS Docker Desktop tricks
There seems to be an issue with ipv6 on MacOS (it seems like Docker Desktop doesn't support it).
There are a few Github issues related to it:
A fix seems to be to tweak the IPv6 config on Mac by:
- Go to Settings > Wi-Fi > Click the "Details..." button next to your network
- Under "TCP/IP" set "Configure IPv6" to "Link-local only"
- Restart Nomad
- In the Nomad UI, verify the fix by going to the client node and check the "unique.network.ip-address" attribute and verify that its an ipv4 address (instead of a ipv6 one)
Volumes
locals {
# Get the absolute path of the current directory
path = abspath(".")
}
job "example" {
datacenters = ["dc1"]
group "group" {
task "task" {
driver = "docker"
config {
image = "busybox:1"
command = "/bin/sh"
args = ["-c", "echo ok; sleep 300"]
volumes = ["${local.path}:/data"]
}
}
}
}
From this Github comment
Last update:
August 12, 2023
Created: June 3, 2023
Created: June 3, 2023