{"action":"created","issue":{"url":"https://api.github.com/repos/moby/moby/issues/36881","repository_url":"https://api.github.com/repos/moby/moby","labels_url":"https://api.github.com/repos/moby/moby/issues/36881/labels{/name}","comments_url":"https://api.github.com/repos/moby/moby/issues/36881/comments","events_url":"https://api.github.com/repos/moby/moby/issues/36881/events","html_url":"https://github.com/moby/moby/pull/36881","id":315358971,"number":36881,"title":"Parse multi-platforms parameters with containerd method","user":{"login":"arm64b","id":29669302,"avatar_url":"https://avatars1.githubusercontent.com/u/29669302?v=4","gravatar_id":"","url":"https://api.github.com/users/arm64b","html_url":"https://github.com/arm64b","followers_url":"https://api.github.com/users/arm64b/followers","following_url":"https://api.github.com/users/arm64b/following{/other_user}","gists_url":"https://api.github.com/users/arm64b/gists{/gist_id}","starred_url":"https://api.github.com/users/arm64b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arm64b/subscriptions","organizations_url":"https://api.github.com/users/arm64b/orgs","repos_url":"https://api.github.com/users/arm64b/repos","events_url":"https://api.github.com/users/arm64b/events{/privacy}","received_events_url":"https://api.github.com/users/arm64b/received_events","type":"User","site_admin":false},"labels":[{"id":175375407,"url":"https://api.github.com/repos/moby/moby/labels/status/2-code-review","name":"status/2-code-review","color":"fad8c7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-04-18T07:17:39Z","updated_at":"2018-04-27T04:45:23Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/moby/moby/pulls/36881","html_url":"https://github.com/moby/moby/pull/36881","diff_url":"https://github.com/moby/moby/pull/36881.diff","patch_url":"https://github.com/moby/moby/pull/36881.patch"},"body":"Currently we use 2 temporary functions to parse and validate the platform parameters specified by `--platform` or `FROM [--platform=platform] imagename[:tag]` in Dockerfile. This patch replaces those 2 functions with the `Parse` function in containerd to align with OCI specification.\r\n\r\nThere're 2 purposes of this PR:\r\n1. Prepare for the multi-platforms support in future, so we need to switch all the platform info, as the first step,  to the `specs.Platform` specified by OCI spec. Refer to issue #36552.\r\n2. Fix below issues for an experimental enabled docker daemon:\r\n`#docker build --rm --no-cache --platform darwin -t multi-platform:test .`\r\nError response from daemon: invalid platform: invalid platform os \"darwin\"\r\n\r\n`darwin` should be a known OS can be assigned as the OS/Arch pair when supporting multi-platforms feature.\r\n\r\nAfter this PR applied, the output is:\r\n`#docker build --rm --no-cache --platform darwin -t multi-platform:test .`\r\n```\r\nSending build context to Docker daemon  15.93MB\r\nStep 1/2 : FROM arm32v6/alpine:3.7\r\n ---> 889c6315e8d7\r\nStep 2/2 : CMD [\"sh\", \"-c\" , \"uname -a\"]\r\n ---> Running in 385315473b54\r\nRemoving intermediate container 385315473b54\r\n ---> 8fc16846649b\r\nSuccessfully built 8fc16846649b\r\nSuccessfully tagged arm32:test\r\n```\r\n<!--\r\nPlease make sure you've read and understood our contributing guidelines;\r\nhttps://github.com/moby/moby/blob/master/CONTRIBUTING.md\r\n\r\n** Make sure all your commits include a signature generated with `git commit -s` **\r\n\r\nFor additional information on our contributing process, read our contributing\r\nguide https://docs.docker.com/opensource/code/\r\n\r\nIf this is a bug fix, make sure your description includes \"fixes #xxxx\", or\r\n\"closes #xxxx\"\r\n\r\nPlease provide the following information:\r\n-->\r\n\r\n**- What I did**\r\nOCI spec platform parameters parsing and validation\r\n**- How I did it**\r\nTake use of the routine provided by containerd\r\n**- How to verify it**\r\n\r\n**- Description for the changelog**\r\n<!--\r\nWrite a short (one line) summary that describes the changes in this\r\npull request for inclusion in the changelog:\r\n-->\r\n\r\n\r\n**- A picture of a cute animal (not mandatory but encouraged)**\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/moby/moby/issues/comments/384862675","html_url":"https://github.com/moby/moby/pull/36881#issuecomment-384862675","issue_url":"https://api.github.com/repos/moby/moby/issues/36881","id":384862675,"user":{"login":"arm64b","id":29669302,"avatar_url":"https://avatars1.githubusercontent.com/u/29669302?v=4","gravatar_id":"","url":"https://api.github.com/users/arm64b","html_url":"https://github.com/arm64b","followers_url":"https://api.github.com/users/arm64b/followers","following_url":"https://api.github.com/users/arm64b/following{/other_user}","gists_url":"https://api.github.com/users/arm64b/gists{/gist_id}","starred_url":"https://api.github.com/users/arm64b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arm64b/subscriptions","organizations_url":"https://api.github.com/users/arm64b/orgs","repos_url":"https://api.github.com/users/arm64b/repos","events_url":"https://api.github.com/users/arm64b/events{/privacy}","received_events_url":"https://api.github.com/users/arm64b/received_events","type":"User","site_admin":false},"created_at":"2018-04-27T04:45:23Z","updated_at":"2018-04-27T04:45:23Z","author_association":"CONTRIBUTOR","body":"Hello @kolyshkin , right, thanks for the remind about git bisect, will squash soon 👍 "}}
{"actor":{"display_login":"arm64b"}}