Environment Variables
mac env shows, sets, and clears the variables that drive MAC's behavior — registry,
master IP, switch credentials, and more.
mac env
~$ mac env # List managed variables and their sources
~$ mac env set KEY=VAL [...] # Save to ~/.mac/env (per-user, persistent)
~$ mac env unset KEY [...] # Remove from ~/.mac/env
File Priority
MAC reads variables from the following files, highest priority first:
~/.mac/env— Per-user overrides (written bymac env set)/etc/mango/mac/env— Global defaults (written by the installer; edit as root)
Shell environment variables are ignored for managed variables — always use mac env set
so the value survives restarts. The two exceptions are MAC_CONFIG_DIR and
MAC_IMAGE_SOURCE, which may be exported in the shell to scope a value to a single
invocation or node (useful when $HOME is NFS-shared).
If your $HOME is shared across hosts (e.g. NFS-mounted), keep per-host values like
NODE_NAME out of ~/.mac/env; put them in /etc/mango/mac/env instead.
Image Source
MAC_IMAGE_SOURCE selects where MAC images come from: registry (default — pull
published images) or local (build from a source checkout via the .build.yml compose
overrides). Resolution order is deliberately different from other variables so a
per-node build choice can't be masked by an NFS-shared ~/.mac/env:
- Process environment (
MAC_IMAGE_SOURCE=local mac start master) /etc/mango/mac/env(global)~/.mac/env(user)
The --local / --registry flags on mac pull, mac start, and mac restart
override all of the above for one invocation.