I want to dockerize a NET Core Application.
However i do not know how I can provide the port
as a command-line
argument to further use it in the Dockerfile
like:
ENTRYPOINT ["appname","[port_argument_from_commandline]"]"
.
Dockerfile
FROM microsoft/dotnet:latest AS base
WORKDIR /app
COPY ./bin/Release/netcoreapp2.1/publish /app
ENTRYPOINT [ "dotnet","DockerContainerDaemon.dll" ]
EXPOSE 20000 //how can i set this as a command-line argument?
Further clarification: I want to provide my image with a configurable argument in our case lets say port
.Then i want when i run an instance to set this argument with a value:
docker build myapp
//configured to accept a command line argument named port
docker run port=[instance port] myapp