{"action":"created","issue":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-docker/issues/108","repository_url":"https://api.github.com/repos/terraform-providers/terraform-provider-docker","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-docker/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-docker/issues/108/comments","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-docker/issues/108/events","html_url":"https://github.com/terraform-providers/terraform-provider-docker/pull/108","id":374780359,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2Mzg1MTgz","number":108,"title":"Add container logs option","user":{"login":"bhuisgen","id":159157,"node_id":"MDQ6VXNlcjE1OTE1Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/159157?v=4","gravatar_id":"","url":"https://api.github.com/users/bhuisgen","html_url":"https://github.com/bhuisgen","followers_url":"https://api.github.com/users/bhuisgen/followers","following_url":"https://api.github.com/users/bhuisgen/following{/other_user}","gists_url":"https://api.github.com/users/bhuisgen/gists{/gist_id}","starred_url":"https://api.github.com/users/bhuisgen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhuisgen/subscriptions","organizations_url":"https://api.github.com/users/bhuisgen/orgs","repos_url":"https://api.github.com/users/bhuisgen/repos","events_url":"https://api.github.com/users/bhuisgen/events{/privacy}","received_events_url":"https://api.github.com/users/bhuisgen/received_events","type":"User","site_admin":false},"labels":[{"id":737832158,"node_id":"MDU6TGFiZWw3Mzc4MzIxNTg=","url":"https://api.github.com/repos/terraform-providers/terraform-provider-docker/labels/size/L","name":"size/L","color":"ffffff","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-28T17:55:39Z","updated_at":"2018-10-28T19:36:04Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-docker/pulls/108","html_url":"https://github.com/terraform-providers/terraform-provider-docker/pull/108","diff_url":"https://github.com/terraform-providers/terraform-provider-docker/pull/108.diff","patch_url":"https://github.com/terraform-providers/terraform-provider-docker/pull/108.patch"},"body":"This PR adds the feature to retrieve the logs of a ```docker_container``` resource allowing to parse them inside the plan or to store them with a  ```local_file``` resource.  The ```attach``` option must be enabled.\r\n\r\nSample plan to test:\r\n\r\n```\r\nresource \"docker_image\" \"busybox\" {\r\n  name = \"busybox:latest\"\r\n}\r\n\r\nresource \"docker_container\" \"test\" {\r\n  image   = \"${docker_image.busybox.name}\"\r\n  name    = \"test\"\r\n  restart = \"no\"\r\n\r\n  command  = [\"/bin/sh\", \"-c\", \"for i in $(seq 1 10); do echo \\\"$i\\\" && sleep 1; done;exit 123\"]\r\n  must_run = false\r\n  attach   = true   # required\r\n  logs     = true   # enable this option to retrieve logs and save them in `container_logs`\r\n}\r\n\r\nresource \"local_file\" \"logs\" {\r\n    filename = \"container.log\"\r\n    content = \"${docker_container.test.container_logs}\"\r\n}\r\n```\r\n\r\n```\r\n18:49 $ cat container.log \r\n1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n7\r\n8\r\n9\r\n10\r\n```"},"comment":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-docker/issues/comments/433734683","html_url":"https://github.com/terraform-providers/terraform-provider-docker/pull/108#issuecomment-433734683","issue_url":"https://api.github.com/repos/terraform-providers/terraform-provider-docker/issues/108","id":433734683,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzczNDY4Mw==","user":{"login":"mavogel","id":8409778,"node_id":"MDQ6VXNlcjg0MDk3Nzg=","avatar_url":"https://avatars0.githubusercontent.com/u/8409778?v=4","gravatar_id":"","url":"https://api.github.com/users/mavogel","html_url":"https://github.com/mavogel","followers_url":"https://api.github.com/users/mavogel/followers","following_url":"https://api.github.com/users/mavogel/following{/other_user}","gists_url":"https://api.github.com/users/mavogel/gists{/gist_id}","starred_url":"https://api.github.com/users/mavogel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mavogel/subscriptions","organizations_url":"https://api.github.com/users/mavogel/orgs","repos_url":"https://api.github.com/users/mavogel/repos","events_url":"https://api.github.com/users/mavogel/events{/privacy}","received_events_url":"https://api.github.com/users/mavogel/received_events","type":"User","site_admin":false},"created_at":"2018-10-28T19:36:04Z","updated_at":"2018-10-28T19:36:04Z","author_association":"COLLABORATOR","body":"@bhuisgen yes you're right. I merged an old PR today and probably this one came in. I'm on it..."}}
{"actor":{"display_login":"mavogel"}}