0

I have an application and it is docker containerized, which contains the program executable and other stuff.

Now how can I make the executable name as a linux environment variable(permanently and not the terminal temporary)?

One option that I have is to edit .profile/.bashrc/.cshrc from some script and add add the PATH variable, however I believe this is not a good idea to follow.

Edit: My only requirement is that the executable should be an environment variable whenever any user pulls and uses the image.

kat_16
  • 39
  • 6
  • This can be done, but it is probably not a good idea. Why is this question tagged with docker? You want to do that in the image? – Henry Aug 20 '20 at 13:03
  • Yes @Henry I thought the same that it's not a good idea to follow. My only requirement is that the when the user pull the image the executable inside the image should be environment variable. (Updated above as well) – kat_16 Aug 20 '20 at 13:31
  • Why an environment variable? Why Docker? In general programs can't change environment variables in the shell that launched them or anywhere else, Docker containers can't affect files on their hosts, and it's not really user-friendly to automatically edit users' dotfiles. – David Maze Aug 21 '20 at 01:20

1 Answers1

0

I copied the executable in my user/bin area while containerization it, the image will contain the exe in the /bin area which will make it work for all the users while pulling the image.

kat_16
  • 39
  • 6