How do you set environment variables?
See original GitHub issueI tried something like:
CreateContainerResponse containerResponse = dockerClient.createContainerCmd("testApp")
.withEnv("DISPLAY=$DISPLAY")
.exec();
but this doesn’t seem to work. The $DISPLAY mentioned is supposed to be the value of the environment variable on the Ubuntu system where the docker daemon is running. I verified that it’s properly defined.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How To Set Environment Variables - Twilio
Setting environment variables in Windows using the GUI is hidden behind several layers of settings dialogs. To open the respective interface you ...
Read more >How do I set an environment variable? - Schrödinger
In the User variables section, select the environment variable you want to modify. · Click Edit to open the Edit User Variable dialog...
Read more >How do I set or change the PATH system variable? - Java
Windows 10 and Windows 8 · In Search, search for and then select: System (Control Panel) · Click the Advanced system settings link....
Read more >How to set the path and environment variables in Windows
In the Environment Variables window (pictured below), highlight the Path variable in the System variables section and click the Edit button. Add ...
Read more >Set Environment Variable in Windows {How-To} - phoenixNAP
Set Environment Variable in Windows via GUI · 1. Press Windows + R to open the Windows Run prompt. · 2. Type in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Shanky2304 In https://docs.docker.com/engine/reference/run/#env-environment-variables :
In that case AFAIK the value is read from client environment.
Back to your example, you can read
DISPLAY
env variable and pass it to Java code:It that code runs on docker daemon you will get what you want.
@orzeh I’m sorry, I don’t understand. What do you mean I don’t have access? What should have I done differently?