{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/8838","labels_url":"https://api.github.com/repos/docker/docker/issues/8838/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/8838/comments","events_url":"https://api.github.com/repos/docker/docker/issues/8838/events","html_url":"https://github.com/docker/docker/issues/8838","id":47117017,"number":8838,"title":"How to set an enviroment variable on an existing container?","user":{"login":"Boran","id":405059,"avatar_url":"https://avatars.githubusercontent.com/u/405059?v=3","gravatar_id":"","url":"https://api.github.com/users/Boran","html_url":"https://github.com/Boran","followers_url":"https://api.github.com/users/Boran/followers","following_url":"https://api.github.com/users/Boran/following{/other_user}","gists_url":"https://api.github.com/users/Boran/gists{/gist_id}","starred_url":"https://api.github.com/users/Boran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Boran/subscriptions","organizations_url":"https://api.github.com/users/Boran/orgs","repos_url":"https://api.github.com/users/Boran/repos","events_url":"https://api.github.com/users/Boran/events{/privacy}","received_events_url":"https://api.github.com/users/Boran/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-10-29T06:56:48Z","updated_at":"2015-05-08T09:13:12Z","closed_at":"2015-01-14T21:36:42Z","body":"One can pass environment vars into new containers when building them with \"docker run\":\r\ndocker run -e \"FOO=bar\" ...\r\n\r\nBut how can one do that for an existing container, there is no -e option for docker run.\r\nI wish to be able to restart a container with a new environment setting, but do not wish to actually recreate the container (as it has lots of manual changes in there).\r\n\r\nOne option might be to commit the container to an image and create a new container based on that image. Seems a very roundabout way though.\r\n\r\nhave I missed something?"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/100168528","html_url":"https://github.com/docker/docker/issues/8838#issuecomment-100168528","issue_url":"https://api.github.com/repos/docker/docker/issues/8838","id":100168528,"user":{"login":"bletvaska","id":714806,"avatar_url":"https://avatars.githubusercontent.com/u/714806?v=3","gravatar_id":"","url":"https://api.github.com/users/bletvaska","html_url":"https://github.com/bletvaska","followers_url":"https://api.github.com/users/bletvaska/followers","following_url":"https://api.github.com/users/bletvaska/following{/other_user}","gists_url":"https://api.github.com/users/bletvaska/gists{/gist_id}","starred_url":"https://api.github.com/users/bletvaska/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bletvaska/subscriptions","organizations_url":"https://api.github.com/users/bletvaska/orgs","repos_url":"https://api.github.com/users/bletvaska/repos","events_url":"https://api.github.com/users/bletvaska/events{/privacy}","received_events_url":"https://api.github.com/users/bletvaska/received_events","type":"User","site_admin":false},"created_at":"2015-05-08T09:13:12Z","updated_at":"2015-05-08T09:13:12Z","body":"Yes. It will be very useful. At the moment, my workaround is this:\r\n\r\ndocker exec -i CONTAINER_ID /bin/bash -c \"export VAR1=VAL1 && export VAR2=VAL2 && run_cmd\""}}