{"action":"closed","issue":{"url":"https://api.github.com/repos/docker/compose/issues/4164","repository_url":"https://api.github.com/repos/docker/compose","labels_url":"https://api.github.com/repos/docker/compose/issues/4164/labels{/name}","comments_url":"https://api.github.com/repos/docker/compose/issues/4164/comments","events_url":"https://api.github.com/repos/docker/compose/issues/4164/events","html_url":"https://github.com/docker/compose/issues/4164","id":189840586,"number":4164,"title":"Environment variables with folded-style string values contain a newline at the end","user":{"login":"dead10ck","id":846275,"avatar_url":"https://avatars.githubusercontent.com/u/846275?v=3","gravatar_id":"","url":"https://api.github.com/users/dead10ck","html_url":"https://github.com/dead10ck","followers_url":"https://api.github.com/users/dead10ck/followers","following_url":"https://api.github.com/users/dead10ck/following{/other_user}","gists_url":"https://api.github.com/users/dead10ck/gists{/gist_id}","starred_url":"https://api.github.com/users/dead10ck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dead10ck/subscriptions","organizations_url":"https://api.github.com/users/dead10ck/orgs","repos_url":"https://api.github.com/users/dead10ck/repos","events_url":"https://api.github.com/users/dead10ck/events{/privacy}","received_events_url":"https://api.github.com/users/dead10ck/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-16T20:51:29Z","updated_at":"2016-11-18T21:57:10Z","closed_at":"2016-11-18T21:57:10Z","body":"It seems that if one uses a folded-style (`>`) long string for an environment variable, a newline gets inserted at the end of the string. A trivial example:\r\n\r\n```yaml\r\nversion: '2'\r\nservices:\r\n  foo:\r\n    image: python:2.7\r\n    environment:\r\n      FOO: >\r\n        This is\r\n        a\r\n        very long\r\n        line\r\n```\r\n\r\n```sh\r\n[I] /t/docker-compose-folded-line ∫ dc run --rm foo /bin/bash                                                     [12:50:07] \r\nroot@fdb2b163415c:/# python\r\nPython 2.7.12 (default, Nov 10 2016, 08:18:45) \r\n[GCC 4.9.2] on linux2\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import os\r\n>>> os.environ['FOO']\r\n'This is a very long line\\n'\r\n```"}}
{"actor":{"display_login":"dead10ck"}}