{"action":"created","comment":{"url":"https://api.github.com/repos/google/go-containerregistry/pulls/comments/185000541","pull_request_review_id":116292959,"id":185000541,"diff_hunk":"@@ -0,0 +1,121 @@\n+This command rewrites an image's manifest to replace layers in a base image\n+with layers in another version of that base image. It does so entirely with API\n+calls to the registry, so it doesn't have to download or upload full layer\n+blobs, if it can be avoided.\n+\n+This can be useful if you want to produce container images that pick up\n+security or bug fixes in base images, without having to completely rebuild the\n+image from source. For instance, you might not have access to the original\n+source anymore, or you want to produce updated images without performing a full\n+rebuild.\n+\n+*WARNING:* The image that results from such a rebase might not be valid in all\n+cases. More details below, but caveat emptor.\n+\n+## Using `crane rebase`\n+\n+For purposes of illustration, imagine you've built a container image\n+`gcr.io/my-project/my-app:latest`, containing your app, and based on some OS\n+image, for instance, `ubuntu`. A vulnerability has been found in the base\n+image, and a new fixed version has been released.\n+\n+You could build your app image again, and its `FROM ubuntu` directive would\n+pick up the new base image release, but that requires a full rebuild of your\n+entire app from source, which might pull in other changes in dependencies. You\n+just want to release this critical bug fix, as quickly as possible.\n+\n+Instead, you could use `crane rebase` to replace the vulnerable base image\n+layers in your image with new patched base image layers from the newly released\n+base image, without needing to rebuild from source, or indeed have access to\n+the source at all.\n+\n+```\n+$ crane rebase \\\n+  --original=gcr.io/my-project/my-app:latest \\\n+  --old_base=ubuntu@sha256:deadbeef... \\\n+  --new_base=ubuntu:latest \\\n+  --rebased=gcr.io/my-project/my-app:rebased\n+```\n+\n+This command would fetch the manifest for `original`, `old_base` and `new_base`,\n+check that `old_base` is indeed the basis for `original`, remove `old_base`'s\n+layers from `original` and replace them with `new_base`'s layers, then compute\n+and upload a new valid manifest for the image, tagged as `rebased`.\n+\n+If the image is in Google Container Registry, you can determine `old_base` image\n+digests using `gcloud alpha container images describe <image>\n+--show-image-basis`.","path":"cmd/crane/rebase.md","position":47,"original_position":47,"commit_id":"b13783f1cb5c92024294685c419bd4bc43c7ccd6","original_commit_id":"b13783f1cb5c92024294685c419bd4bc43c7ccd6","user":{"login":"mattmoor","id":2442466,"avatar_url":"https://avatars3.githubusercontent.com/u/2442466?v=4","gravatar_id":"","url":"https://api.github.com/users/mattmoor","html_url":"https://github.com/mattmoor","followers_url":"https://api.github.com/users/mattmoor/followers","following_url":"https://api.github.com/users/mattmoor/following{/other_user}","gists_url":"https://api.github.com/users/mattmoor/gists{/gist_id}","starred_url":"https://api.github.com/users/mattmoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattmoor/subscriptions","organizations_url":"https://api.github.com/users/mattmoor/orgs","repos_url":"https://api.github.com/users/mattmoor/repos","events_url":"https://api.github.com/users/mattmoor/events{/privacy}","received_events_url":"https://api.github.com/users/mattmoor/received_events","type":"User","site_admin":false},"body":"Is this available widely enough to be something to point out here?","created_at":"2018-04-30T14:22:11Z","updated_at":"2018-04-30T14:42:20Z","html_url":"https://github.com/google/go-containerregistry/pull/121#discussion_r185000541","pull_request_url":"https://api.github.com/repos/google/go-containerregistry/pulls/121","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/google/go-containerregistry/pulls/comments/185000541"},"html":{"href":"https://github.com/google/go-containerregistry/pull/121#discussion_r185000541"},"pull_request":{"href":"https://api.github.com/repos/google/go-containerregistry/pulls/121"}}},"pull_request":{"url":"https://api.github.com/repos/google/go-containerregistry/pulls/121","id":184935362,"html_url":"https://github.com/google/go-containerregistry/pull/121","diff_url":"https://github.com/google/go-containerregistry/pull/121.diff","patch_url":"https://github.com/google/go-containerregistry/pull/121.patch","issue_url":"https://api.github.com/repos/google/go-containerregistry/issues/121","number":121,"state":"open","locked":false,"title":"Add mutate.Rebase and crane rebase that uses it","user":{"login":"ImJasonH","id":210737,"avatar_url":"https://avatars1.githubusercontent.com/u/210737?v=4","gravatar_id":"","url":"https://api.github.com/users/ImJasonH","html_url":"https://github.com/ImJasonH","followers_url":"https://api.github.com/users/ImJasonH/followers","following_url":"https://api.github.com/users/ImJasonH/following{/other_user}","gists_url":"https://api.github.com/users/ImJasonH/gists{/gist_id}","starred_url":"https://api.github.com/users/ImJasonH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ImJasonH/subscriptions","organizations_url":"https://api.github.com/users/ImJasonH/orgs","repos_url":"https://api.github.com/users/ImJasonH/repos","events_url":"https://api.github.com/users/ImJasonH/events{/privacy}","received_events_url":"https://api.github.com/users/ImJasonH/received_events","type":"User","site_admin":false},"body":"This is ported from https://github.com/google/image-rebase\r\n\r\nThis change also includes:\r\n- a test of rebase and seam detection in the form of a GCB build\r\n- artisanally hand-crafted documentation","created_at":"2018-04-30T11:40:21Z","updated_at":"2018-04-30T14:42:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6c407b924f9c9a8ba1afe84966ac35de5e46b7c7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/go-containerregistry/pulls/121/commits","review_comments_url":"https://api.github.com/repos/google/go-containerregistry/pulls/121/comments","review_comment_url":"https://api.github.com/repos/google/go-containerregistry/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/go-containerregistry/issues/121/comments","statuses_url":"https://api.github.com/repos/google/go-containerregistry/statuses/b13783f1cb5c92024294685c419bd4bc43c7ccd6","head":{"label":"ImJasonH:rebase","ref":"rebase","sha":"b13783f1cb5c92024294685c419bd4bc43c7ccd6","user":{"login":"ImJasonH","id":210737,"avatar_url":"https://avatars1.githubusercontent.com/u/210737?v=4","gravatar_id":"","url":"https://api.github.com/users/ImJasonH","html_url":"https://github.com/ImJasonH","followers_url":"https://api.github.com/users/ImJasonH/followers","following_url":"https://api.github.com/users/ImJasonH/following{/other_user}","gists_url":"https://api.github.com/users/ImJasonH/gists{/gist_id}","starred_url":"https://api.github.com/users/ImJasonH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ImJasonH/subscriptions","organizations_url":"https://api.github.com/users/ImJasonH/orgs","repos_url":"https://api.github.com/users/ImJasonH/repos","events_url":"https://api.github.com/users/ImJasonH/events{/privacy}","received_events_url":"https://api.github.com/users/ImJasonH/received_events","type":"User","site_admin":false},"repo":{"id":129794866,"name":"go-containerregistry","full_name":"ImJasonH/go-containerregistry","owner":{"login":"ImJasonH","id":210737,"avatar_url":"https://avatars1.githubusercontent.com/u/210737?v=4","gravatar_id":"","url":"https://api.github.com/users/ImJasonH","html_url":"https://github.com/ImJasonH","followers_url":"https://api.github.com/users/ImJasonH/followers","following_url":"https://api.github.com/users/ImJasonH/following{/other_user}","gists_url":"https://api.github.com/users/ImJasonH/gists{/gist_id}","starred_url":"https://api.github.com/users/ImJasonH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ImJasonH/subscriptions","organizations_url":"https://api.github.com/users/ImJasonH/orgs","repos_url":"https://api.github.com/users/ImJasonH/repos","events_url":"https://api.github.com/users/ImJasonH/events{/privacy}","received_events_url":"https://api.github.com/users/ImJasonH/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ImJasonH/go-containerregistry","description":null,"fork":true,"url":"https://api.github.com/repos/ImJasonH/go-containerregistry","forks_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/forks","keys_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/teams","hooks_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/hooks","issue_events_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/issues/events{/number}","events_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/events","assignees_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/assignees{/user}","branches_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/branches{/branch}","tags_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/tags","blobs_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/git/refs{/sha}","trees_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/statuses/{sha}","languages_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/languages","stargazers_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/stargazers","contributors_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/contributors","subscribers_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/subscribers","subscription_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/subscription","commits_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/commits{/sha}","git_commits_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/git/commits{/sha}","comments_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/comments{/number}","issue_comment_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/issues/comments{/number}","contents_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/contents/{+path}","compare_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/merges","archive_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/downloads","issues_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/issues{/number}","pulls_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/pulls{/number}","milestones_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/milestones{/number}","notifications_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/labels{/name}","releases_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/releases{/id}","deployments_url":"https://api.github.com/repos/ImJasonH/go-containerregistry/deployments","created_at":"2018-04-16T19:27:18Z","updated_at":"2018-04-18T18:13:55Z","pushed_at":"2018-04-30T11:37:52Z","git_url":"git://github.com/ImJasonH/go-containerregistry.git","ssh_url":"git@github.com:ImJasonH/go-containerregistry.git","clone_url":"https://github.com/ImJasonH/go-containerregistry.git","svn_url":"https://github.com/ImJasonH/go-containerregistry","homepage":null,"size":1036,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"d5ac5fa9d1f8fc3180a674089995116f9308dd2a","user":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":125253663,"name":"go-containerregistry","full_name":"google/go-containerregistry","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/go-containerregistry","description":null,"fork":false,"url":"https://api.github.com/repos/google/go-containerregistry","forks_url":"https://api.github.com/repos/google/go-containerregistry/forks","keys_url":"https://api.github.com/repos/google/go-containerregistry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/go-containerregistry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/go-containerregistry/teams","hooks_url":"https://api.github.com/repos/google/go-containerregistry/hooks","issue_events_url":"https://api.github.com/repos/google/go-containerregistry/issues/events{/number}","events_url":"https://api.github.com/repos/google/go-containerregistry/events","assignees_url":"https://api.github.com/repos/google/go-containerregistry/assignees{/user}","branches_url":"https://api.github.com/repos/google/go-containerregistry/branches{/branch}","tags_url":"https://api.github.com/repos/google/go-containerregistry/tags","blobs_url":"https://api.github.com/repos/google/go-containerregistry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/go-containerregistry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/go-containerregistry/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/go-containerregistry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/go-containerregistry/statuses/{sha}","languages_url":"https://api.github.com/repos/google/go-containerregistry/languages","stargazers_url":"https://api.github.com/repos/google/go-containerregistry/stargazers","contributors_url":"https://api.github.com/repos/google/go-containerregistry/contributors","subscribers_url":"https://api.github.com/repos/google/go-containerregistry/subscribers","subscription_url":"https://api.github.com/repos/google/go-containerregistry/subscription","commits_url":"https://api.github.com/repos/google/go-containerregistry/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/go-containerregistry/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/go-containerregistry/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/go-containerregistry/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/go-containerregistry/contents/{+path}","compare_url":"https://api.github.com/repos/google/go-containerregistry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/go-containerregistry/merges","archive_url":"https://api.github.com/repos/google/go-containerregistry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/go-containerregistry/downloads","issues_url":"https://api.github.com/repos/google/go-containerregistry/issues{/number}","pulls_url":"https://api.github.com/repos/google/go-containerregistry/pulls{/number}","milestones_url":"https://api.github.com/repos/google/go-containerregistry/milestones{/number}","notifications_url":"https://api.github.com/repos/google/go-containerregistry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/go-containerregistry/labels{/name}","releases_url":"https://api.github.com/repos/google/go-containerregistry/releases{/id}","deployments_url":"https://api.github.com/repos/google/go-containerregistry/deployments","created_at":"2018-03-14T18:02:49Z","updated_at":"2018-04-30T13:28:52Z","pushed_at":"2018-04-30T13:28:51Z","git_url":"git://github.com/google/go-containerregistry.git","ssh_url":"git@github.com:google/go-containerregistry.git","clone_url":"https://github.com/google/go-containerregistry.git","svn_url":"https://github.com/google/go-containerregistry","homepage":null,"size":1943,"stargazers_count":29,"watchers_count":29,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":10,"open_issues":21,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/go-containerregistry/pulls/121"},"html":{"href":"https://github.com/google/go-containerregistry/pull/121"},"issue":{"href":"https://api.github.com/repos/google/go-containerregistry/issues/121"},"comments":{"href":"https://api.github.com/repos/google/go-containerregistry/issues/121/comments"},"review_comments":{"href":"https://api.github.com/repos/google/go-containerregistry/pulls/121/comments"},"review_comment":{"href":"https://api.github.com/repos/google/go-containerregistry/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/go-containerregistry/pulls/121/commits"},"statuses":{"href":"https://api.github.com/repos/google/go-containerregistry/statuses/b13783f1cb5c92024294685c419bd4bc43c7ccd6"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"mattmoor"}}