0

I am currently trying to explore of a way on how to possibly make my dockerfile generic where it can be used by any .net projects.

My docker file looks like this. I have parameterized the base image to be used. And now I want to try to parameterized the EntryPoint instead of writing "mydotnet.dll" I want it to be passed as a variable/argument during docker build.

My docker file

ARG var1

FROM $var1

WORKDIR /app/  
COPY . .

EXPOSE 80

ENTRYPOINT ["dotnet", "mydotnet.dll"]
jabbson
  • 4,390
  • 1
  • 13
  • 23
cypher-lad
  • 15
  • 3
  • Does this answer your question? [How to pass arguments to a Dockerfile?](https://stackoverflow.com/questions/34254200/how-to-pass-arguments-to-a-dockerfile) – Sasha Nov 19 '21 at 04:16
  • that is how I pass for var1. now I wonder how to possibly parameterize the "mydotnet.dll" – cypher-lad Nov 19 '21 at 05:24
  • It seems like you're trying to parameterize every single line of the Dockerfile; but then wouldn't your settings be as complex as the original Dockerfile? – David Maze Nov 19 '21 at 14:24
  • my only goal is to parameterize the base image and the entrypoint, which will be passed on the docker run command. I am successful for the BaseImage ($var1) but when I tried same approach for the entry point it's just not working – cypher-lad Nov 21 '21 at 04:58

0 Answers0