Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment variable TERM cannot be overwritten #121

Open
galou opened this issue Mar 8, 2021 · 2 comments
Open

Environment variable TERM cannot be overwritten #121

galou opened this issue Mar 8, 2021 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@galou
Copy link
Contributor

galou commented Mar 8, 2021

I use rocker --network host --device /dev/dri/card0 --x11 --pulse --user --home --env "DISPLAY" "XDG_CONFIG_HOME=~/.config" TERM=xterm-256color -- my_image. The final docker call is docker run -it --rm --device /dev/dri/card0 --device /dev/dri/card0 -e DISPLAY -e 'XDG_CONFIG_HOME=~/.config' -e TERM=xterm-256color -v /home/gael:/home/gael --network host -v /run/user/1000/pulse:/run/user/1000/pulse --device /dev/snd -e PULSE_SERVER=unix:/run/user/1000/pulse/native -v /run/user/1000/pulse/native:/run/user/1000/pulse/native --group-add 29 -e DISPLAY -e TERM -e QT_X11_NO_MITSHM=1 -e XAUTHORITY=/tmp/.docker.xauth -v /tmp/.docker.xauth:/tmp/.docker.xauth -v /tmp/.X11-unix:/tmp/.X11-unix -v /etc/localtime:/etc/localtime:ro d3ddfa229ca8.

The TERM environment is set twice and the last one takes TERM from the calling environment, which in my case doesn't work because this particular terminal is not installed in the image. I know some workarounds but this is inconvenient.

@tfoote
Copy link
Collaborator

tfoote commented Mar 10, 2021

The best approach to resolve this is for the x11 plugin which is generating those to be able to query for command line arguments that would mask it and use that here:

return " -e DISPLAY -e TERM \

I'm not sure how complicated it would be to do that lookup and resolution. The quicker solution would be to simply make sure that the user set environment variables come later in the arguments so that they win. And this will allow all things to be manually overridden.

@tfoote tfoote added enhancement New feature or request help wanted Extra attention is needed labels Mar 10, 2021
@galou
Copy link
Contributor Author

galou commented Mar 23, 2021

I chose the second option: PR #130 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants