Skip to content

nerdctl build on Windows cannot use alternative Dockerfile with absolute path #8190

Description

@horihel

Actual Behavior

Command:
nerdctl build --tag mytag . --file Dockerfile.custom

this always fails with

FATA[0000] lstat /Dockerfile.custom: no such file or directory

so it puts a / in front of whatever you specify - so even with a context of ".", it cannot find the file.

Trying to use an absolute path doesn't work either, as it seems to convert it weirdly:

nerdctl build --tag mytag . --file /d/repos/Dockerfile.cypress

FATA[0000] lstat /D:/repos/Dockerfile.cypress: no such file or directory

Steps to Reproduce

  • Have a repo with a non-standard Dockerfile name (on windows)
  • try to specify your Dockerfile with nerdctl build . -file
  • fail

Result

FATA[0000] lstat /Dockerfile.custom: no such file or directory

Expected Behavior

nerdctl builds with the custom dockerfile just like it successfully builds with a file called "Dockerfile"

Additional Information

No response

Rancher Desktop Version

1.17.1

Rancher Desktop K8s Version

1.32.1

Which container engine are you using?

containerd (nerdctl)

What operating system are you using?

Windows

Operating System / Build Version

Windows 11 23H2 Build 22631.4751

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

None

Windows User Only

FortiVPN is active most of the time.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions