HI,
I need to maintain a lot of Dockerfiles for different archs, e.g., x86_64 and ppc64le, in many cases, the Dockerfiles for different archs are almost identical only with some minor differences, here is an example:
Dockerfile.x86_64:
FROM golang:1.8.1
# RUN xxxx
# RUN yyy
Dockerfile.ppc64le:
FROM ppc64le/golang:1.8.1
# RUN xxxx
# RUN yyy
The only difference in the x86_64 Dockerfile and ppc64le Dockerfile is the base image, maintaining different Dockerfiles for different archs are time-consuming and error-prone, I will have to remember to update the same thing in a few Dockerfiles all the time…
https://github.com/moby/moby/issues/735 proposed the Makefile and Dockerfile.in solution, but this will add more complexities, is there any easier way that I do not need to maintain two different Dockerfiles for different archs?
Your responses will be appreciated.