Skip to content

WORKDIR command fails on Windows images #378

Closed
moby/buildkit
#2249
@claudiubelu

Description

Sample Dockerfile:

ARG BASEIMAGE
FROM $BASEIMAGE

WORKDIR "C:\Users"

ENTRYPOINT ["cmd.exe", "/s", "/c"]

Command: docker buildx build --no-cache --pull --output=type=registry --platform windows/amd64 --build-arg BASEIMAGE=mcr.microsoft.com/windows/nanoserver:1809 -t claudiubelu/workdir-sample:1.0 .

Fails with the following message:

[+] Building 0.3s (5/5) FINISHED
 => [internal] load .dockerignore                                                                             0.1s
 => => transferring context: 2B                                                                               0.0s
 => [internal] load build definition from Dockerfile_windows                                                  0.1s
 => => transferring dockerfile: 721B                                                                          0.0s
 => [internal] load metadata for mcr.microsoft.com/windows/nanoserver:1809                                    0.1s
 => CACHED [1/2] FROM mcr.microsoft.com/windows/nanoserver:1809@sha256:4e2935a71de933e3576f7053d75eb3fadc3a9  0.0s
 => => resolve mcr.microsoft.com/windows/nanoserver:1809@sha256:4e2935a71de933e3576f7053d75eb3fadc3a929a1e7a  0.0s
 => ERROR [2/2] WORKDIR C:\Users                                                                              0.1s
------
 > [2/2] WORKDIR C:\Users:
------
failed to solve: rpc error: code = Unknown desc = open /tmp/buildkit-mount549039607/etc/passwd: no such file or directory

docker buildx version: github.com/docker/buildx v0.4.1-25-ge24e04b e24e04b

Activity

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions