How to use multiple commands in the Docker Entrypoint for a vFunction Controller


Overview of the Issue

  1. An organization uses a Linux Container to start a .NET Application
  2. vFunction recommends using a startup.sh script to start the vFunction Controller process at runtime and start the Application
  3. The organization cannot replace the Entrypoint with a startup.sh script because it is against the organization’s policy
### Instead of DLL, the filename of the dll would be listed below

ENTRYPOINT ["dotnet", "DLL"]

Solution

  1. Create a multi-command Entrypoint to first run the vFunction restart-controller.sh script and then run the dotnet command
### Find-and-Replace WORKDIR with the WORKDIR of the Application
### Find-and-replace DLL with the DLL that is run for the application

ENTRYPOINT ["/bin/bash", "-c", "bash /tmp/vfunction/opt/vfunction/controller-installation/restart-controller.sh -i default-dotnet;cd WORKDIR;dotnet DLL"]
  1. Build and Deploy the Application