{"action":"created","comment":{"url":"https://api.github.com/repos/dokku/dokku-postgres/pulls/comments/43843578","id":43843578,"diff_hunk":"@@ -31,8 +31,13 @@ case \"$1\" in\n     touch \"$LINKS_FILE\"\n \n     dokku_log_info1 \"Starting container\"\n+    if [[ -n $POSTGRES_DOCKER_ARGS ]]; then\n+      echo \"$POSTGRES_DOCKER_ARGS\" | tr ';' \"\\n\" > \"$SERVICE_ROOT/ENVIRONMENT\"\n+    else\n+      echo \"\" > \"$SERVICE_ROOT/ENVIRONMENT\"\n+    fi\n     SERVICE_NAME=$(get_service_name \"$SERVICE\")\n-    ID=$(docker run --name \"$SERVICE_NAME\" -v \"$SERVICE_ROOT/data:/var/lib/postgresql/data\" -e \"POSTGRES_PASSWORD=$password\" -d --restart always --label dokku=service --label dokku.service=postgres \"$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION\")\n+    ID=$(docker run --name \"$SERVICE_NAME\" -v \"$SERVICE_ROOT/data:/var/lib/postgresql/data\" --env-file=\"$SERVICE_ROOT/ENVIRONMENT\" -e \"POSTGRES_PASSWORD=$password\" -d --restart always --label dokku=service --label dokku.service=postgres \"$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION\")","path":"commands","position":11,"original_position":11,"commit_id":"c68ac3be25b99dc2081a4ac218b8c0722ba6ae7d","original_commit_id":"c68ac3be25b99dc2081a4ac218b8c0722ba6ae7d","user":{"login":"josegonzalez","id":65675,"avatar_url":"https://avatars.githubusercontent.com/u/65675?v=3","gravatar_id":"","url":"https://api.github.com/users/josegonzalez","html_url":"https://github.com/josegonzalez","followers_url":"https://api.github.com/users/josegonzalez/followers","following_url":"https://api.github.com/users/josegonzalez/following{/other_user}","gists_url":"https://api.github.com/users/josegonzalez/gists{/gist_id}","starred_url":"https://api.github.com/users/josegonzalez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josegonzalez/subscriptions","organizations_url":"https://api.github.com/users/josegonzalez/orgs","repos_url":"https://api.github.com/users/josegonzalez/repos","events_url":"https://api.github.com/users/josegonzalez/events{/privacy}","received_events_url":"https://api.github.com/users/josegonzalez/received_events","type":"User","site_admin":false},"body":"I'll take a quick once-over in the morning before merging. I know @Flink has a different schedule and is a bit more familiar with this, so if he gives a +1, we are good to go.","created_at":"2015-11-04T05:10:06Z","updated_at":"2015-11-04T05:10:06Z","html_url":"https://github.com/dokku/dokku-postgres/pull/40#discussion_r43843578","pull_request_url":"https://api.github.com/repos/dokku/dokku-postgres/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/dokku/dokku-postgres/pulls/comments/43843578"},"html":{"href":"https://github.com/dokku/dokku-postgres/pull/40#discussion_r43843578"},"pull_request":{"href":"https://api.github.com/repos/dokku/dokku-postgres/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/dokku/dokku-postgres/pulls/40","id":48827056,"html_url":"https://github.com/dokku/dokku-postgres/pull/40","diff_url":"https://github.com/dokku/dokku-postgres/pull/40.diff","patch_url":"https://github.com/dokku/dokku-postgres/pull/40.patch","issue_url":"https://api.github.com/repos/dokku/dokku-postgres/issues/40","number":40,"state":"open","locked":false,"title":"Allow use of postgres images with wal-e","user":{"login":"mcolyer","id":1424,"avatar_url":"https://avatars.githubusercontent.com/u/1424?v=3","gravatar_id":"","url":"https://api.github.com/users/mcolyer","html_url":"https://github.com/mcolyer","followers_url":"https://api.github.com/users/mcolyer/followers","following_url":"https://api.github.com/users/mcolyer/following{/other_user}","gists_url":"https://api.github.com/users/mcolyer/gists{/gist_id}","starred_url":"https://api.github.com/users/mcolyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcolyer/subscriptions","organizations_url":"https://api.github.com/users/mcolyer/orgs","repos_url":"https://api.github.com/users/mcolyer/repos","events_url":"https://api.github.com/users/mcolyer/events{/privacy}","received_events_url":"https://api.github.com/users/mcolyer/received_events","type":"User","site_admin":true},"body":"I'd like to be able to start postgres images which have wal-e installed to allow for continous backups as well as restores from backups (see https://github.com/mcolyer/docker-postgres-wale for details). In order to do that I needed to be able to:\r\n\r\n* Pass arbitrary environment variables to the underlying docker container\r\n* Permit `postgres:create` to proceed even if the database already exists.\r\n\r\nIn order to do that I changed the signature of `postgres:create` to permit environment variable pairs to be passed through. I'm open to other suggestions but this seemed the simplest way to achieve what I was looking for.","created_at":"2015-10-27T04:12:43Z","updated_at":"2015-11-04T05:10:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b99857fc001aa8506b0be526ef72ce17072c2e0d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dokku/dokku-postgres/pulls/40/commits","review_comments_url":"https://api.github.com/repos/dokku/dokku-postgres/pulls/40/comments","review_comment_url":"https://api.github.com/repos/dokku/dokku-postgres/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dokku/dokku-postgres/issues/40/comments","statuses_url":"https://api.github.com/repos/dokku/dokku-postgres/statuses/c68ac3be25b99dc2081a4ac218b8c0722ba6ae7d","head":{"label":"mcolyer:allow-postgres-restore","ref":"allow-postgres-restore","sha":"c68ac3be25b99dc2081a4ac218b8c0722ba6ae7d","user":{"login":"mcolyer","id":1424,"avatar_url":"https://avatars.githubusercontent.com/u/1424?v=3","gravatar_id":"","url":"https://api.github.com/users/mcolyer","html_url":"https://github.com/mcolyer","followers_url":"https://api.github.com/users/mcolyer/followers","following_url":"https://api.github.com/users/mcolyer/following{/other_user}","gists_url":"https://api.github.com/users/mcolyer/gists{/gist_id}","starred_url":"https://api.github.com/users/mcolyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcolyer/subscriptions","organizations_url":"https://api.github.com/users/mcolyer/orgs","repos_url":"https://api.github.com/users/mcolyer/repos","events_url":"https://api.github.com/users/mcolyer/events{/privacy}","received_events_url":"https://api.github.com/users/mcolyer/received_events","type":"User","site_admin":true},"repo":{"id":44852068,"name":"dokku-postgres","full_name":"mcolyer/dokku-postgres","owner":{"login":"mcolyer","id":1424,"avatar_url":"https://avatars.githubusercontent.com/u/1424?v=3","gravatar_id":"","url":"https://api.github.com/users/mcolyer","html_url":"https://github.com/mcolyer","followers_url":"https://api.github.com/users/mcolyer/followers","following_url":"https://api.github.com/users/mcolyer/following{/other_user}","gists_url":"https://api.github.com/users/mcolyer/gists{/gist_id}","starred_url":"https://api.github.com/users/mcolyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcolyer/subscriptions","organizations_url":"https://api.github.com/users/mcolyer/orgs","repos_url":"https://api.github.com/users/mcolyer/repos","events_url":"https://api.github.com/users/mcolyer/events{/privacy}","received_events_url":"https://api.github.com/users/mcolyer/received_events","type":"User","site_admin":true},"private":false,"html_url":"https://github.com/mcolyer/dokku-postgres","description":"BETA: a postgres plugin for dokku","fork":true,"url":"https://api.github.com/repos/mcolyer/dokku-postgres","forks_url":"https://api.github.com/repos/mcolyer/dokku-postgres/forks","keys_url":"https://api.github.com/repos/mcolyer/dokku-postgres/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mcolyer/dokku-postgres/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mcolyer/dokku-postgres/teams","hooks_url":"https://api.github.com/repos/mcolyer/dokku-postgres/hooks","issue_events_url":"https://api.github.com/repos/mcolyer/dokku-postgres/issues/events{/number}","events_url":"https://api.github.com/repos/mcolyer/dokku-postgres/events","assignees_url":"https://api.github.com/repos/mcolyer/dokku-postgres/assignees{/user}","branches_url":"https://api.github.com/repos/mcolyer/dokku-postgres/branches{/branch}","tags_url":"https://api.github.com/repos/mcolyer/dokku-postgres/tags","blobs_url":"https://api.github.com/repos/mcolyer/dokku-postgres/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mcolyer/dokku-postgres/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mcolyer/dokku-postgres/git/refs{/sha}","trees_url":"https://api.github.com/repos/mcolyer/dokku-postgres/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mcolyer/dokku-postgres/statuses/{sha}","languages_url":"https://api.github.com/repos/mcolyer/dokku-postgres/languages","stargazers_url":"https://api.github.com/repos/mcolyer/dokku-postgres/stargazers","contributors_url":"https://api.github.com/repos/mcolyer/dokku-postgres/contributors","subscribers_url":"https://api.github.com/repos/mcolyer/dokku-postgres/subscribers","subscription_url":"https://api.github.com/repos/mcolyer/dokku-postgres/subscription","commits_url":"https://api.github.com/repos/mcolyer/dokku-postgres/commits{/sha}","git_commits_url":"https://api.github.com/repos/mcolyer/dokku-postgres/git/commits{/sha}","comments_url":"https://api.github.com/repos/mcolyer/dokku-postgres/comments{/number}","issue_comment_url":"https://api.github.com/repos/mcolyer/dokku-postgres/issues/comments{/number}","contents_url":"https://api.github.com/repos/mcolyer/dokku-postgres/contents/{+path}","compare_url":"https://api.github.com/repos/mcolyer/dokku-postgres/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mcolyer/dokku-postgres/merges","archive_url":"https://api.github.com/repos/mcolyer/dokku-postgres/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mcolyer/dokku-postgres/downloads","issues_url":"https://api.github.com/repos/mcolyer/dokku-postgres/issues{/number}","pulls_url":"https://api.github.com/repos/mcolyer/dokku-postgres/pulls{/number}","milestones_url":"https://api.github.com/repos/mcolyer/dokku-postgres/milestones{/number}","notifications_url":"https://api.github.com/repos/mcolyer/dokku-postgres/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mcolyer/dokku-postgres/labels{/name}","releases_url":"https://api.github.com/repos/mcolyer/dokku-postgres/releases{/id}","created_at":"2015-10-24T04:22:50Z","updated_at":"2015-10-24T04:22:51Z","pushed_at":"2015-11-03T05:24:31Z","git_url":"git://github.com/mcolyer/dokku-postgres.git","ssh_url":"git@github.com:mcolyer/dokku-postgres.git","clone_url":"https://github.com/mcolyer/dokku-postgres.git","svn_url":"https://github.com/mcolyer/dokku-postgres","homepage":"","size":171,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dokku:master","ref":"master","sha":"8f392acf2266f2e73860f529124f893f7ca3d511","user":{"login":"dokku","id":13455795,"avatar_url":"https://avatars.githubusercontent.com/u/13455795?v=3","gravatar_id":"","url":"https://api.github.com/users/dokku","html_url":"https://github.com/dokku","followers_url":"https://api.github.com/users/dokku/followers","following_url":"https://api.github.com/users/dokku/following{/other_user}","gists_url":"https://api.github.com/users/dokku/gists{/gist_id}","starred_url":"https://api.github.com/users/dokku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dokku/subscriptions","organizations_url":"https://api.github.com/users/dokku/orgs","repos_url":"https://api.github.com/users/dokku/repos","events_url":"https://api.github.com/users/dokku/events{/privacy}","received_events_url":"https://api.github.com/users/dokku/received_events","type":"Organization","site_admin":false},"repo":{"id":41235251,"name":"dokku-postgres","full_name":"dokku/dokku-postgres","owner":{"login":"dokku","id":13455795,"avatar_url":"https://avatars.githubusercontent.com/u/13455795?v=3","gravatar_id":"","url":"https://api.github.com/users/dokku","html_url":"https://github.com/dokku","followers_url":"https://api.github.com/users/dokku/followers","following_url":"https://api.github.com/users/dokku/following{/other_user}","gists_url":"https://api.github.com/users/dokku/gists{/gist_id}","starred_url":"https://api.github.com/users/dokku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dokku/subscriptions","organizations_url":"https://api.github.com/users/dokku/orgs","repos_url":"https://api.github.com/users/dokku/repos","events_url":"https://api.github.com/users/dokku/events{/privacy}","received_events_url":"https://api.github.com/users/dokku/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dokku/dokku-postgres","description":"BETA: a postgres plugin for dokku","fork":false,"url":"https://api.github.com/repos/dokku/dokku-postgres","forks_url":"https://api.github.com/repos/dokku/dokku-postgres/forks","keys_url":"https://api.github.com/repos/dokku/dokku-postgres/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dokku/dokku-postgres/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dokku/dokku-postgres/teams","hooks_url":"https://api.github.com/repos/dokku/dokku-postgres/hooks","issue_events_url":"https://api.github.com/repos/dokku/dokku-postgres/issues/events{/number}","events_url":"https://api.github.com/repos/dokku/dokku-postgres/events","assignees_url":"https://api.github.com/repos/dokku/dokku-postgres/assignees{/user}","branches_url":"https://api.github.com/repos/dokku/dokku-postgres/branches{/branch}","tags_url":"https://api.github.com/repos/dokku/dokku-postgres/tags","blobs_url":"https://api.github.com/repos/dokku/dokku-postgres/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dokku/dokku-postgres/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dokku/dokku-postgres/git/refs{/sha}","trees_url":"https://api.github.com/repos/dokku/dokku-postgres/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dokku/dokku-postgres/statuses/{sha}","languages_url":"https://api.github.com/repos/dokku/dokku-postgres/languages","stargazers_url":"https://api.github.com/repos/dokku/dokku-postgres/stargazers","contributors_url":"https://api.github.com/repos/dokku/dokku-postgres/contributors","subscribers_url":"https://api.github.com/repos/dokku/dokku-postgres/subscribers","subscription_url":"https://api.github.com/repos/dokku/dokku-postgres/subscription","commits_url":"https://api.github.com/repos/dokku/dokku-postgres/commits{/sha}","git_commits_url":"https://api.github.com/repos/dokku/dokku-postgres/git/commits{/sha}","comments_url":"https://api.github.com/repos/dokku/dokku-postgres/comments{/number}","issue_comment_url":"https://api.github.com/repos/dokku/dokku-postgres/issues/comments{/number}","contents_url":"https://api.github.com/repos/dokku/dokku-postgres/contents/{+path}","compare_url":"https://api.github.com/repos/dokku/dokku-postgres/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dokku/dokku-postgres/merges","archive_url":"https://api.github.com/repos/dokku/dokku-postgres/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dokku/dokku-postgres/downloads","issues_url":"https://api.github.com/repos/dokku/dokku-postgres/issues{/number}","pulls_url":"https://api.github.com/repos/dokku/dokku-postgres/pulls{/number}","milestones_url":"https://api.github.com/repos/dokku/dokku-postgres/milestones{/number}","notifications_url":"https://api.github.com/repos/dokku/dokku-postgres/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dokku/dokku-postgres/labels{/name}","releases_url":"https://api.github.com/repos/dokku/dokku-postgres/releases{/id}","created_at":"2015-08-23T04:10:37Z","updated_at":"2015-11-01T15:42:48Z","pushed_at":"2015-11-03T05:24:31Z","git_url":"git://github.com/dokku/dokku-postgres.git","ssh_url":"git@github.com:dokku/dokku-postgres.git","clone_url":"https://github.com/dokku/dokku-postgres.git","svn_url":"https://github.com/dokku/dokku-postgres","homepage":"","size":541,"stargazers_count":18,"watchers_count":18,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dokku/dokku-postgres/pulls/40"},"html":{"href":"https://github.com/dokku/dokku-postgres/pull/40"},"issue":{"href":"https://api.github.com/repos/dokku/dokku-postgres/issues/40"},"comments":{"href":"https://api.github.com/repos/dokku/dokku-postgres/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/dokku/dokku-postgres/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/dokku/dokku-postgres/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dokku/dokku-postgres/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/dokku/dokku-postgres/statuses/c68ac3be25b99dc2081a4ac218b8c0722ba6ae7d"}}}}