oduwsdl / MemGator

A Memento Aggregator CLI and Server in Go
https://memgator.cs.odu.edu/api.html
MIT License
56 stars 11 forks source link

Utilize Multi-Stage Build feature of Dockerfile #99

Closed ibnesayeed closed 4 years ago

ibnesayeed commented 7 years ago

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.

ibnesayeed commented 7 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.

machawk1 commented 7 years ago

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?

ibnesayeed commented 7 years ago

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.

ibnesayeed commented 7 years ago

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.

ibnesayeed commented 7 years ago

Waiting the support to arrive to DockerHub as per https://github.com/docker/hub-feedback/issues/1039 before we can commit such changes.