{"action":"opened","issue":{"url":"https://api.github.com/repos/docker/for-win/issues/2282","repository_url":"https://api.github.com/repos/docker/for-win","labels_url":"https://api.github.com/repos/docker/for-win/issues/2282/labels{/name}","comments_url":"https://api.github.com/repos/docker/for-win/issues/2282/comments","events_url":"https://api.github.com/repos/docker/for-win/issues/2282/events","html_url":"https://github.com/docker/for-win/issues/2282","id":344806808,"node_id":"MDU6SXNzdWUzNDQ4MDY4MDg=","number":2282,"title":"WORKDIR does not set the working directory for the rest of the Dockerfile","user":{"login":"Chris-P-Bacon","id":19429908,"node_id":"MDQ6VXNlcjE5NDI5OTA4","avatar_url":"https://avatars3.githubusercontent.com/u/19429908?v=4","gravatar_id":"","url":"https://api.github.com/users/Chris-P-Bacon","html_url":"https://github.com/Chris-P-Bacon","followers_url":"https://api.github.com/users/Chris-P-Bacon/followers","following_url":"https://api.github.com/users/Chris-P-Bacon/following{/other_user}","gists_url":"https://api.github.com/users/Chris-P-Bacon/gists{/gist_id}","starred_url":"https://api.github.com/users/Chris-P-Bacon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chris-P-Bacon/subscriptions","organizations_url":"https://api.github.com/users/Chris-P-Bacon/orgs","repos_url":"https://api.github.com/users/Chris-P-Bacon/repos","events_url":"https://api.github.com/users/Chris-P-Bacon/events{/privacy}","received_events_url":"https://api.github.com/users/Chris-P-Bacon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-26T11:35:04Z","updated_at":"2018-07-26T11:35:04Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nPlease, check https://docs.docker.com/docker-for-windows/troubleshoot/.\r\nIssues without logs and details cannot be debugged, and will be closed.\r\n\r\nIssues unrelated to Docker for Windows will be closed.  In particular, see\r\n  - https://github.com/docker/compose/issues for docker-compose\r\n  - https://github.com/docker/machine/issues for docker-machine\r\n  - https://github.com/moby/moby/issues for Docker daemon\r\n  - https://github.com/docker/docker.github.io/issues for the documentation\r\n-->\r\n\r\n\r\n<!-- Replace `- [ ]` with `- [x]`, or click after having submitted the issue. -->\r\n  - [x] I have tried with the latest version of my channel (Stable or Edge)\r\n  - [ ] I have uploaded Diagnostics\r\n\r\n### Expected behavior\r\nAccording to the docs: The WORKDIR instruction sets the working directory for any RUN, CMD, ENTRYPOINT, COPY and ADD instructions that follow it in the Dockerfile.\r\n\r\n```\r\nFROM microsoft/dotnet:2.1-sdk AS build\r\nWORKDIR /build\r\n\r\nFROM build as tests\r\nWORKDIR /tests\r\n\r\nFROM build as publish\r\nRUN pwd\r\n```\r\nExpected output of docker build:\r\n\r\n> Step 1/6 : FROM microsoft/dotnet:2.1-sdk AS build\r\nStep 2/6 : WORKDIR /build\r\nStep 3/6 : FROM build as tests\r\nStep 4/6 : WORKDIR /tests\r\nStep 5/6 : FROM build as publish\r\nStep 6/6 : RUN pwd\r\n/tests\r\n\r\n\r\n\r\n### Actual behavior\r\nEvery stage inherits its working directory from its base image.\r\nActual\r\n\r\n\r\n output of docker build:\r\n\r\n> Step 1/6 : FROM microsoft/dotnet:2.1-sdk AS build\r\nStep 2/6 : WORKDIR /build\r\nStep 3/6 : FROM build as tests\r\nStep 4/6 : WORKDIR /tests\r\nStep 5/6 : FROM build as publish\r\nStep 6/6 : RUN pwd\r\n/build\r\n\r\n### Information\r\n  - Windows Version: Windows 10 Enterprise 1803\r\n  - Docker for Windows Version:\r\n\r\n> Client:\r\n Version:           18.06.0-ce\r\n API version:       1.38\r\n Go version:        go1.10.3\r\n Git commit:        0ffa825\r\n Built:             Wed Jul 18 19:05:28 2018\r\n OS/Arch:           windows/amd64\r\n Experimental:      false\r\nServer:\r\n Engine:\r\n  Version:          18.06.0-ce\r\n  API version:      1.38 (minimum version 1.12)\r\n  Go version:       go1.10.3\r\n  Git commit:       0ffa825\r\n  Built:            Wed Jul 18 19:13:46 2018\r\n  OS/Arch:          linux/amd64\r\n  Experimental:     false\r\n\r\n### Steps to reproduce the behavior\r\nBuild attached [Dockerfile.txt](https://github.com/docker/for-win/files/2231713/Dockerfile.txt)"}}
{"actor":{"display_login":"Chris-P-Bacon"}}