packer-cn/website/pages/docs/environment-variables.mdx

61 lines
2.6 KiB
Plaintext
Raw Normal View History

2020-03-18 18:46:47 -04:00
---
description: Packer uses a variety of environmental variables.
layout: docs
page_title: Environment Variables - Other
sidebar_title: Environment Variables
2020-03-18 18:46:47 -04:00
---
# Environment Variables for Packer
Packer uses a variety of environmental variables. A listing and description of
each can be found below:
- `PACKER_CACHE_DIR` - The location of the packer cache.
- `PACKER_CONFIG` - The location of the core configuration file. The format
of the configuration file is basic JSON. See the [core configuration
2020-04-01 17:12:30 -04:00
page](/docs/core-configuration).
2020-03-18 18:46:47 -04:00
- `PACKER_CONFIG_DIR` - The location of the `.packer.d` config directory
- `PACKER_LOG` - Setting this to any value other than "" (empty string) or
"0" will enable the logger. See the [debugging
2020-03-31 17:40:07 -04:00
page](/docs/other/debugging).
2020-03-18 18:46:47 -04:00
- `PACKER_LOG_PATH` - The location of the log file. Note: `PACKER_LOG` must
be set for any logging to occur. See the [debugging
2020-03-31 17:40:07 -04:00
page](/docs/other/debugging).
2020-03-18 18:46:47 -04:00
- `PACKER_NO_COLOR` - Setting this to any value will disable color in the
terminal.
- `PACKER_PLUGIN_MAX_PORT` - The maximum port that Packer uses for
communication with plugins, since plugin communication happens over TCP
connections on your local host. The default is 25,000. See the [core
2020-03-31 17:40:07 -04:00
configuration page](/docs/other/core-configuration).
2020-03-18 18:46:47 -04:00
- `PACKER_PLUGIN_MIN_PORT` - The minimum port that Packer uses for
communication with plugins, since plugin communication happens over TCP
connections on your local host. The default is 10,000. See the [core
2020-03-31 17:40:07 -04:00
configuration page](/docs/other/core-configuration).
2020-03-18 18:46:47 -04:00
- `PACKER_PLUGIN_PATH` - a PATH variable for finding third-party packer
plugins. For example: `~/custom-dir-1:~/custom-dir-2`.
Separate directories in the PATH string using a colon (`:`) on posix systems and
a semicolon (`;`) on windows systems. The above example path would be able to
find a provisioner named `packer-provisioner-foo` in either
`~/custom-dir-1/packer-provisioner-foo` or
`~/custom-dir-2/packer-provisioner-foo`.
- `CHECKPOINT_DISABLE` - When Packer is invoked it sometimes calls out to
[checkpoint.hashicorp.com](https://checkpoint.hashicorp.com/) to look for
new versions of Packer. If you want to disable this for security or privacy
reasons, you can set this environment variable to `1`.
- `TMPDIR` (Unix) / `TMP` `TEMP` `USERPROFILE` (Windows) - The location of
the directory used for temporary files (defaults to `/tmp` on Linux/Unix
and `%USERPROFILE%\AppData\Local\Temp` on Windows Vista and above). It
might be necessary to customize it when working with large files since
`/tmp` is a memory-backed filesystem in some Linux distributions in which
case `/var/tmp` might be preferred.