Setting up a Nomad dev environment on macOS

I found some tricks with getting a Nomad dev environment working reliably on Mac, particularly a Apple Silicon Mac.

I found the main problem was with how Docker Desktop doesn’t support IPv6, so if your Mac is connected to your network with a IPv6 address, Nomad will try to bound your containers to a IPv6 address which Docker Desktop can’t handle.

Fix

  1. Verify that your Mac has IPv6 configured correctly
    1. Go to Settings > Wi-Fi > Click the “Details…” button next to your network
    2. Under “TCP/IP” set “Configure IPv6” to “Link-local only”
  2. Start Docker Desktop
  3. Start Nomad in a terminal (keep the terminal open in the background)
nomad agent -dev -bind 0.0.0.0 -network-interface=en0
  1. Double check that Nomad is using an IPv4 address
    1. Visit http://localhost:4646/ in your browser
    2. Click “Clients” from the left sidebar
    3. Select the client, it should be named the same as your Mac’s hostname
    4. Under “Attributes” check the unique.network.ip-address value, it should be an IPv4 address (if its a IPv6 address, check Step 1)

You might need to repeat Step 1 if you connect to a different Wi-Fi network.

For more information, see my Dev Environment notes.