Closed ibnesayeed closed 4 years ago
We need to wait until Docker 17.06 is released which will be a stable version of Docker. Before that, the support for multi-build won't be available in DockerHub for automated builds.
It might be good to created the multi-stage Dockerfile in advance in a branch for quick merging once 17.06 is released. Is there a way to specify with Docker to use different versions of a Dockerfile based on the local system's Docker version?
It might be good to created the multi-stage Dockerfile in advance in a branch for quick merging once 17.06 is released.
That's a possibility. I will perhaps create a branch locally to test this. This one is not just about updating the Dockerfile, but some other changes would be needed to streamline the build process with the new setup.
Is there a way to specify with Docker to use different versions of a Dockerfile based on the local system's Docker version?
Yes, you can specify a file name to be used as the Dockerfile during build. Before multi-stage build support, people used to have multiple Dockerfiles and some shell script to put things together, known as builder pattern. The next stable Docker release being less than two weeks away, I would rather not go the old route.
Waiting the support to arrive to DockerHub as per https://github.com/docker/hub-feedback/issues/1039 before we can commit such changes.
Using newly introduced Multi-Stage Build feature we can remove the
bin
directory and corresponding second Dockerfile. A single Dockerfile will be sufficient for both building and packaging a minimal image. This will simplify the release process.