Docker Community Forums

Share and learn in the Docker community.

CentOS container does not keep TMP env.var

(Randomuser42) #1


I’m trying to build a CentOS container which has an environment variable TMP defined. Running Docker 18.06.1-ce, build e68fc7a.
Here is my Dockerfile:

FROM centos:7.4.1708
ENV TMP="/tmp"
ENV TEMP="/tmp"

I build the container with

docker build -t tmptest .

and run it (for testing) with

docker run --rm -t -i tmptest /bin/bash

Then I check for the environment variables but get this:

[root@3d31a3e9391c /]# echo $TMP

[root@3d31a3e9391c /]# echo $TEMP

Any idea what is going on there?