Skip to content

LCOW - Change platform parser directive to FROM statement flag#35089

Merged
johnstep merged 7 commits intomoby:masterfrom
microsoft:jjh/fromplatformbuilder
Mar 26, 2018
Merged

LCOW - Change platform parser directive to FROM statement flag#35089
johnstep merged 7 commits intomoby:masterfrom
microsoft:jjh/fromplatformbuilder

Conversation

@lowenna
Copy link
Member

@lowenna lowenna commented Oct 4, 2017

This removes the # platform=.... parser directive, and adds --platform as a flag to the FROM statement instead. This is one of the action items from the F2F in SF in August 2017, and the document described in #34617. It's a direct follow-on to #34859 which is now merged in master

image

@tianon
Copy link
Member

tianon commented Oct 5, 2017

@stevvooe this is one of the sort of things you had in mind when you created containerd/containerd#1403, right?

@stevvooe
Copy link
Contributor

stevvooe commented Oct 5, 2017

@tianon Yes. We need to massage that package to meet these use cases.

@lowenna lowenna force-pushed the jjh/fromplatformbuilder branch 3 times, most recently from 217be81 to b60609f Compare October 5, 2017 22:48
@lowenna lowenna force-pushed the jjh/fromplatformbuilder branch from b60609f to 63cd7cc Compare October 25, 2017 22:53
@lowenna lowenna force-pushed the jjh/fromplatformbuilder branch from 63cd7cc to abf631a Compare January 9, 2018 22:52
@lowenna
Copy link
Member Author

lowenna commented Jan 9, 2018

Rebased on latest iteration of #34859, and taken account of merging of #35429

@lowenna lowenna force-pushed the jjh/fromplatformbuilder branch from abf631a to c0ab585 Compare January 18, 2018 17:07
@lowenna
Copy link
Member Author

lowenna commented Jan 18, 2018

Rebased on #34859 again to keep fresh

@lowenna lowenna force-pushed the jjh/fromplatformbuilder branch from c0ab585 to a16c1f6 Compare January 19, 2018 18:07
@lowenna lowenna changed the title [WIP - Not ready for review] LCOW - Platform parser directive to FROM statement flag LCOW - Change platform parser directive to FROM statement flag Jan 19, 2018
@lowenna
Copy link
Member Author

lowenna commented Jan 19, 2018

@johnstep @tonistiigi @stevvooe PTAL. I've now rebased it after #34859 was merged and tidied it up. Ready for review.

@lowenna lowenna force-pushed the jjh/fromplatformbuilder branch 2 times, most recently from c4c26be to cb8355e Compare January 25, 2018 16:52
@lowenna lowenna force-pushed the jjh/fromplatformbuilder branch 2 times, most recently from 7d8a4a4 to b2d34ce Compare February 6, 2018 00:09
John Howard added 7 commits March 19, 2018 14:29
Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: John Howard <jhoward@microsoft.com>
@lowenna lowenna force-pushed the jjh/fromplatformbuilder branch from fb82b3f to 1442905 Compare March 19, 2018 21:30
lowenna pushed a commit to microsoft/docker that referenced this pull request Mar 19, 2018
Signed-off-by: John Howard <jhoward@microsoft.com>

Addresses moby#35089 (comment).
This change enables the daemon to automatically select an image under LCOW
that can be used if the API doesn't specify an explicit platform.

For example:

FROM supertest2014/nyan
ADD Dockerfile /

And docker build . will download the linux image (not a multi-manifest image)

And similarly docker pull ubuntu will match linux/amd64
Copy link
Member

@dnephin dnephin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tonistiigi
Copy link
Member

LGTM
ping @johnstep

Copy link
Member

@johnstep johnstep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

return nil, err
}

flPlatform := req.flags.AddString("platform", "")
Copy link
Member

@johnstep johnstep Mar 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I am not a fan of this Hungarian-style notation, preferring platform or platformFlag. There is a precedent for the fl prefix in the builder, so it's okay, but I think it should be cleaned up eventually. :)

@johnstep johnstep merged commit 29fc64b into moby:master Mar 26, 2018
lowenna pushed a commit to microsoft/docker that referenced this pull request Mar 27, 2018
Signed-off-by: John Howard <jhoward@microsoft.com>

Addresses moby#35089 (comment).
This change enables the daemon to automatically select an image under LCOW
that can be used if the API doesn't specify an explicit platform.

For example:

FROM supertest2014/nyan
ADD Dockerfile /

And docker build . will download the linux image (not a multi-manifest image)

And similarly docker pull ubuntu will match linux/amd64
tonistiigi pushed a commit to tonistiigi/docker that referenced this pull request Jun 26, 2018
Signed-off-by: John Howard <jhoward@microsoft.com>

Addresses moby#35089 (comment).
This change enables the daemon to automatically select an image under LCOW
that can be used if the API doesn't specify an explicit platform.

For example:

FROM supertest2014/nyan
ADD Dockerfile /

And docker build . will download the linux image (not a multi-manifest image)

And similarly docker pull ubuntu will match linux/amd64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/builder Build area/lcow Issues and PR's related to the experimental LCOW feature platform/windows status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants