Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is tail command with docker run entrypoint in visual studio 2019?

I am running Windows 10 pro, docker installed and linux containers.

With Visual Studio 2019, I created a basic .net core web api app, and enabled docker support(linux).

I built the solution, and in the output window (View -> Output or Ctrl + Alt + O) I selected "Container Tools" in the Show Output From drop down. Scroll till the end(see the scroll bar in the below image) and you see the entry point option to the docker run command as follows.

--entrypoint tail webapp:dev -f /dev/null

The entire docker run command for your ref is as follows.

docker run -dt -v "C:\Users\MyUserName\vsdbg\vs2017u5:/remote_debugger:rw" -v "D:\Trials\Docker\VsDocker\src\WebApp:/app" -v "D:\Trials\Docker\VsDocker\src:/src" -v "C:\Users\UserName\.nuget\packages\:/root/.nuget/fallbackpackages" -e "DOTNET_USE_POLLING_FILE_WATCHER=1" -e "ASPNETCORE_ENVIRONMENT=Development" -e "NUGET_PACKAGES=/root/.nuget/fallbackpackages" -e "NUGET_FALLBACK_PACKAGES=/root/.nuget/fallbackpackages" -P --name WebApp --entrypoint tail webapp:dev -f /dev/null 

So my question is what is this "tail". I saw two so questions(this and this) but could not get much. Also from here, tail seems to be a linux command(and I am running a linux container) but what does it do here?

Please enlighten me.

enter image description here

like image 209
VivekDev Avatar asked Mar 29 '20 06:03

VivekDev


1 Answers

Entrypoint is the binary that is being executed.
Example: --entrypoint=bash --entrypoint=helm like this.
The tail linux utility displays the contents of file or, by default, its standard input, to the standard output /dev/null.
/dev/null redirects the command standard output to the null device, which is a special device which discards the information written to it. So when you run a tail -f /dev/null in a terminal it prints nothing.

If you would like to keep your container running in detached mode, you need to run something in the foreground. An easy way to do this is to tail the /dev/null device as the CMD or ENTRYPOINT command of your Docker image.

like image 58
vijay Avatar answered Oct 17 '22 19:10

vijay