简体   繁体   中英

Docker COPY - Windows 10

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM