{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/23042","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/23042/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/23042/comments","events_url":"https://api.github.com/repos/docker/docker/issues/23042/events","html_url":"https://github.com/docker/docker/issues/23042","id":157127638,"number":23042,"title":"not able to update the mounted file via docker exec echo >","user":{"login":"hehailong5","id":17330257,"avatar_url":"https://avatars.githubusercontent.com/u/17330257?v=3","gravatar_id":"","url":"https://api.github.com/users/hehailong5","html_url":"https://github.com/hehailong5","followers_url":"https://api.github.com/users/hehailong5/followers","following_url":"https://api.github.com/users/hehailong5/following{/other_user}","gists_url":"https://api.github.com/users/hehailong5/gists{/gist_id}","starred_url":"https://api.github.com/users/hehailong5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hehailong5/subscriptions","organizations_url":"https://api.github.com/users/hehailong5/orgs","repos_url":"https://api.github.com/users/hehailong5/repos","events_url":"https://api.github.com/users/hehailong5/events{/privacy}","received_events_url":"https://api.github.com/users/hehailong5/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-27T04:25:56Z","updated_at":"2016-05-27T04:32:28Z","closed_at":null,"body":"I am trying to update a mounted file in the container via docker exec.\r\nwhen I run the below:\r\n\r\nroot@nfvo1-E9000:/root# docker exec -ti 2a5df6777095 echo abc > /data/raft/peers.json\r\n-bash: /data/raft/peers.json: No such file or directory\r\n\r\nI realize the wrapped command may look for this file on the docker host, but actually it is mounted at somewhere else on the host, I then try put '' around the command:\r\n\r\nroot@nfvo1-E9000:/root# docker exec -ti 2a5df6777095 'echo abc > /data/raft/peers.json'\r\nCannot run exec command f12b54e8605929bab1d4a2204d4ce739f29ca38d34e96c52fe7e3692fd3bc19c in container 2a5df6777095faa8f66a64ac8fd61191c66758da769eb81dda062a12600557df: [8] System error: exec: \"echo abc > /data/raft/peers.json\": stat echo abc > /data/raft/peers.json: no such file or directory\r\nError starting exec command in container f12b54e8605929bab1d4a2204d4ce739f29ca38d34e96c52fe7e3692fd3bc19c: Cannot run exec command f12b54e8605929bab1d4a2204d4ce739f29ca38d34e96c52fe7e3692fd3bc19c in container 2a5df6777095faa8f66a64ac8fd61191c66758da769eb81dda062a12600557df: [8] System error: exec: \"echo abc > /data/raft/peers.json\": stat echo abc > /data/raft/peers.json: no such file or directory\r\n\r\nthis time it still complains the file is not found, but I can use the vi in the command to edit this file:\r\n\r\ndocker exec -ti 2a5df6777095 vi /data/raft/peers.json"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/222057993","html_url":"https://github.com/docker/docker/issues/23042#issuecomment-222057993","issue_url":"https://api.github.com/repos/docker/docker/issues/23042","id":222057993,"user":{"login":"hehailong5","id":17330257,"avatar_url":"https://avatars.githubusercontent.com/u/17330257?v=3","gravatar_id":"","url":"https://api.github.com/users/hehailong5","html_url":"https://github.com/hehailong5","followers_url":"https://api.github.com/users/hehailong5/followers","following_url":"https://api.github.com/users/hehailong5/following{/other_user}","gists_url":"https://api.github.com/users/hehailong5/gists{/gist_id}","starred_url":"https://api.github.com/users/hehailong5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hehailong5/subscriptions","organizations_url":"https://api.github.com/users/hehailong5/orgs","repos_url":"https://api.github.com/users/hehailong5/repos","events_url":"https://api.github.com/users/hehailong5/events{/privacy}","received_events_url":"https://api.github.com/users/hehailong5/received_events","type":"User","site_admin":false},"created_at":"2016-05-27T04:32:28Z","updated_at":"2016-05-27T04:32:28Z","body":"found the solution:"}}
{"actor":{"display_login":"hehailong5"}}