0

Where is the environment variables mentioned in the docker file being written inside the docker image ? Is there something like bash_profile or .bashrc inside the docker image?

Shammas
  • 381
  • 1
  • 4
  • 15
Nigel Thomas
  • 1,881
  • 8
  • 30
  • 50

1 Answers1

1

No, the environment created by Docker is kept inside Docker but outside the image. You can use docker inspect and related tools to inspect it from outside the image, but from the inside, you can only access the innards of the container.

To simply override something, use the image's native facilities. On Linux, for example, to override FOO, just

export FOO=newvalue

(The export is often cargo-culted to places where it doesn't matter. Its significance is to make the value visible to child processes of the shell where you execute it.)

tripleee
  • 175,061
  • 34
  • 275
  • 318