I am new to the Elm community (this is my first post) and have zero open source contribution experience, but think Issue #1949 could be resolved by improving the current Dockerfile in Elm compiler source. My hypothesis does require new build practices to be followed by Elm maintainers. As such, I hope this community post is an appropriate way to gauge feasability and interest.
Elm compiler source dockerfiles used to distribute official
elm binaries are instructively transparent for community builders. Given the Dockerfile format is human-and-machine readable (like Markdown), maintainers could answer questions like "How do I bulid
email@example.com on distro
abc" by pointing to
git clone --branch x.y.z https://github.com/elm/compiler.git. The main benefit over regular instructions is that automated Docker Hub builds could empirically show which Dockerfile instructions succeed or for what reasons they fail. (For instance, not having updated
ca-certificates leads to
HTTP.elm compilation problems.)
compiler/installers/linux/Dockerfile successfully builds a static
elm binary. I’ve tried to improve upon this base in three different dockerfiles called
Dockerfilecopies an amd64 static binary to an empty docker image for reduced size and easier extraction.
Dockerfile.alpinecopies a non-static amd64 binary onto a Dockerhub Node image for use in amd64 CI/CD.
Dockerfile.debiancopies a non-static multiarch binary onto Docker Hub Node for use in multiarch CI/CD or to extract multiarch binaries for ChromeOS 80’s Buster based Linux container
All three versions
COPY source code over using
git, which makes automated Docker Hub builds a bit faster. In addition, I think these non-git-based-dockerfiles could resolve ‘Issue #1949: requests for “build from source” instructions’ by showcasing how to build and deploy the tagged branch of Elm they reside in. (The idea being if you want to build 0.19.2 or 0.20.0 you’d inspect their dockerfiles for hints like ‘does it use stack?’, ‘does it use cabal?’, or ‘where did the automated Docker Hub build fail/pass between version bumps?’)