maxhallinan maxhallinan - 2 months ago 12x
Node.js Question

Docker container has no TMPDIR environmental variable

I'm running a Node app on node:6.3-wheezy. I noticed that

returns the path to the project directory, which is probably just
. When I run
in the container, I see that there is no
environmental variable. Why is this? I'd like the system to establish it's own temp directory rather than setting it myself.


Because you haven't set TMPDIR.

The only environment variables docker will set are

  • HOME - Set based on the value of USER
  • HOSTNAME - The hostname associated with the container
  • PATH - Includes popular directories, such as : /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  • TERM - xterm if the container is allocated a pseudo-TTY

Anything else is image specific and up to you.

You can set them via an ENV step in a Dockerfile if needed.