0

I have a Docker file based on windowsservercore, which I am hosting an ASP.net Core web application.

Snippet from docker file

ENTRYPOINT ["my.exe"]
ENV ASPNETCORE_URLS http://+:5000
EXPOSE 5000

When running the docker image with the below command, I'm trying to pass optional arguments that will be passed down to my exe endpoint.

docker rm myapp
docker run --net="host" --name myapp -p 5000:5000 myappservice
Komainu85
  • 964
  • 6
  • 22

1 Answers1

1

You need to have either a CMD

https://docs.docker.com/engine/reference/builder/#cmd

Or an ENTRYPOINT

https://docs.docker.com/engine/reference/builder/#entrypoint

In your Dockerfile.

You should read this discussion:

What is the difference between CMD and ENTRYPOINT in a Dockerfile?

And also that one:

Passing Different Arguments When Running Docker Image Multiple Times

i01573
  • 75
  • 2
  • 11
user2915097
  • 30,758
  • 6
  • 57
  • 59
  • he is already using entrypoint so this just points to you need to read... sorry. – Sun Mar 06 '22 at 15:17