Skip to content

Prevent double escaping of Dockerfile commands on Windows#17851

Merged
runcom merged 1 commit intomoby:masterfrom
microsoft:10662-ArgumentEscaping
Nov 14, 2015
Merged

Prevent double escaping of Dockerfile commands on Windows#17851
runcom merged 1 commit intomoby:masterfrom
microsoft:10662-ArgumentEscaping

Conversation

@darstahl
Copy link
Contributor

@darstahl darstahl commented Nov 9, 2015

This fixes #17509

Signed-off-by: Darren Stahl [email protected]

@lowenna
Copy link
Member

lowenna commented Nov 9, 2015

@thaJeztah Any chance of a TP4 tag. This has regressed behaviour from TP3 reported in #17509

@thaJeztah
Copy link
Member

IIUC, this affects the API, so added the impact-label (so we don't forget), may need a docs update as well

Copy link
Member

Choose a reason for hiding this comment

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

Does this really live in Config? Is it needed to be committed to the final image?

Copy link
Member

Choose a reason for hiding this comment

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

This seems also so platform specific

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Where is the best place to put it such that it can be sent from dockerfile/dispatchers.go to the execdriver where it needs to be processed? I put it in Config, as that seemed to be the location for similar parameters. And yes, it is platform specific.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On second thought, I think it does need to live in Config, since it is not a runtime configuration, but rather reflecting the state of the Command.

@darstahl
Copy link
Contributor Author

Rebased

@lowenna
Copy link
Member

lowenna commented Nov 12, 2015

@runcom - Hey Antonio - which bit of the design are you concerned about? That we're adding something to the persistent state? Unfortunately, I believe we need this persisted there (rather than in hostConfig) as it applies to the command which is stored in there, nothing to do with the host configuration where the container runs. There's no way of breaking the config (or hostconfig) into platform specific parts as these are passed through the API complete. It's only daemon side that the platform daemon can work out what applies and what doesn't. This isn't new though or without precedent - there are certainly linux-specific fields in Config (for example we don't have a TTY; support the recently introduced StopSignal as signals don't exist on Windows; User; or PublishService among probably others). Can you ping me on IRC when you get a chance? I'm concerned if this one gets held up as it breaks some images which need to get built for TP4, plus fixes a TP3 regression, and time is running desperately out now. Thanks! 👍

@darrenstahlmsft I do think though you should postpend the comment in the added field (Windows specific) though to make it clear.

@lowenna
Copy link
Member

lowenna commented Nov 12, 2015

BTW - @darrenstahlmsft can you add updates to the API docs. I think docs\reference\api\docker_remote_api_v1.22.md is the right place.

@darstahl darstahl force-pushed the 10662-ArgumentEscaping branch from f1476a9 to bc7ea3f Compare November 12, 2015 02:04
@darstahl
Copy link
Contributor Author

@jhowardmsft Will do on both accounts (just updated PR before I saw your second comment)

@darstahl darstahl force-pushed the 10662-ArgumentEscaping branch from bc7ea3f to c9c9a5f Compare November 12, 2015 02:32
@darstahl
Copy link
Contributor Author

Docs updated, plus moved ArgsEscaped to right after Cmd, as it is directly related. Should I add an example (or change an existing one) of when ArgsEscaped is true?

@lowenna
Copy link
Member

lowenna commented Nov 12, 2015

It wouldn't hurt to add a new one :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this will be logged somewhere upper anyway, at least it should

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, it was there already. But it shouldn't, also such logline will tell nothing to reader.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

@darstahl darstahl force-pushed the 10662-ArgumentEscaping branch from c9c9a5f to 8221a6c Compare November 13, 2015 00:57
@darstahl
Copy link
Contributor Author

Requested changes made, and docs changes removed (Will resend those in a separate PR)

@darstahl darstahl force-pushed the 10662-ArgumentEscaping branch from 8221a6c to 51940d4 Compare November 13, 2015 01:13
Copy link
Contributor

Choose a reason for hiding this comment

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

can be just return "", errors.New(...)

@LK4D4
Copy link
Contributor

LK4D4 commented Nov 13, 2015

LGTM apart from nit

@lowenna
Copy link
Member

lowenna commented Nov 13, 2015

Ping @runcom

@darstahl darstahl force-pushed the 10662-ArgumentEscaping branch from 51940d4 to 9db5db1 Compare November 13, 2015 18:43
@darstahl
Copy link
Contributor Author

Nit fixed

@runcom
Copy link
Member

runcom commented Nov 14, 2015

LGTM

runcom added a commit that referenced this pull request Nov 14, 2015
Prevent double escaping of Dockerfile commands on Windows
@runcom runcom merged commit ad8a665 into moby:master Nov 14, 2015
@runcom
Copy link
Member

runcom commented Nov 14, 2015

Agreed with @jhowardmsft to have a follow-up PR to address docs (if any are needed) ping @thaJeztah

@StefanScherer
Copy link
Contributor

@darrenstahlmsft Thanks! But I have to wait until TP4 as of #17919 😢 ;-) But shouldn't take too long I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Building Windows Docker images doesn't work as well as in previous versions

8 participants