Docker Use Notes - Summary of Problems Encountered in Use

1. Error ": No such file or directory" when starting the container

Generally speaking, the entry point as a container application is the entrypoint.sh file, that is, the last instruction of the Dockerfile is:

ENTRYPOINT ["/entrypoint.sh"]

 

At first I thought that the modified part was wrong, and changed the internal content to only one line of command:

date && pwd

  

Rebuild and start the container, still doesn't work. It is said on the Internet that it is the file permission, but because the Windows system puts the file into the Linux image, the execution permission (+x) is added by default. For a detailed explanation, please refer to here .

original:

That warning was added, because the Windows filesystem does not have an option to mark a file as 'executable'. Building a linux image from a Windows machine would therefore break the image if a file has to be marked executable.

For that reason, files are marked executable by default when building from a windows client; the warning is there so that you are notified of that, and (if needed), modify the Dockerfile to change/remove the executable bit afterwards.

So this explanation skips.

Later, when I saw an answer on SO, I suddenly realized that this problem will be encountered every time I write a shell script on Windows. The problem was with the newline, changed CRLF to LF, kept building and starting the container again and the problem was solved.

 

 

  

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324647479&siteId=291194637
Recommended