I want to create Dockerfile that will be able to build three different images (one at the moment). Those images differs only in configuration files.
I was trying:
- creating three different docker files (doesn't work because dockerfile needs to be named Dockerfile and be in context root
- finding a way of passing parameters to docker build command - didn't find
- using ONBUILD command - I created one main file and three specific ones which were copying specific conf file into same directory in image (it doesn't work because of the same reason as in first point)
- passing docker file from stdin - it doesn't work because there is no context then (so I can't use ADD/COPY commands then)
I must say I run out of ideas:/ How do you handle that situation. In my opinion it should be a common issue.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…