0

I try to create image from docker. Everything works fine for linux and macos, but now for windows 10. I have this line in Dockerfile:

COPY ./docker-entrypoint.sh /docker-entrypoint.sh

and after create image on windows and try to run, get this error:

exec /docker-entrypoint.sh: no such file or directory

Why?

Please explain what the different?

MaxR.
  • 11
  • 1

1 Answers1

0

This is probably related to the line ending character.

You might need to update the line ending form CRLF -> LF.

There are a lot of ways to do this, easist with Notepad++

open the file with Notepad++ and aim to edit --> EOL conversion and choose LF.

Save the dockerfile and try again.

More about changing line ending char can be found in this topic

George
  • 2,292
  • 2
  • 10
  • 21
  • 1
    If this is in fact the issue, also see [Building Docker images on Windows: Entrypoint script "no such file or directory"](https://stackoverflow.com/questions/53165471/building-docker-images-on-windows-entrypoint-script-no-such-file-or-directory) which gives several more suggestions. – David Maze Dec 27 '22 at 16:43