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.

3
  • 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? Commented Aug 20, 2020 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) Commented Aug 20, 2020 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. Commented Aug 21, 2020 at 1:20

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.