This is a linked question to my previous question RUN cmd and execute curl command in VB.NET.
I have a vb.net very small application that makes a api call and prints the response.
Module Module1
Sub Main()
Dim curlApplicationPath = IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "curl.exe")
Dim arguments = $"/k {curlApplicationPath} --location --request GET http://ip:port/"
Process.Start("cmd.exe", arguments)
End Sub
End Module
I want now to run this application in docker (for windows). This is what I wrote in dockerfile.
From mcr.microsoft.com/windows:1903
From curlimages/curl:latest
From mcr.microsoft.com/dotnet/framework/runtime:4.6.2
WORKDIR /app
COPY bin/Release .
ENTRYPOINT ["CurlCall.exe"]
and build the image by running the following command
docker build -t curlcall .
Upon running the following command
docker run --rm -it curlcall
My expected response was hello-world, which I get when I am running my vb.net application outside of docker. But I get no response at all. Then I logged into the interactive session of the image by
docker run -it --entrypoint=cmd.exe curlcall
and tried to run curl google.com and got the response that
'curl' is not recognized as an internal or external command,
operable program or batch file.
Then I copied the curl executeable manually in the docker image and CD into
C:\test\curl-7.79.1-win64-mingw\bin>curl
and ran this command and it works as expected.
curl --location --request GET http://ip:port/
I think this is the main problem that Curl is not configured during the build process, and I search around but couldn't find a way to configure CURL via dockerfile.
I hope I explained the question well. Could anyone please help me figure out the situation?
Thanks a lot in advance.