Stack Docker Bug
Stack has functionality to
build Haskell software in a Docker image
running Alpine Linux, which makes
it very easy to create static executables. Unless an image is specified
in the configuration, a default image is used. In the past, the default
image was pulled from the fpco/stack-build
repository, tagged with the full LTS version (example:
lts-18.3
). At some point, however, new images were no
longer pushed to that repository. Instead, new images are being pushed
to the commercialhaskell/stackage
repository, tagged with the LTS major version (example:
lts18
).
I noticed this bug while developing lsupg, but I figured that it would be fixed in the next release of Stack. Stack 2.7.3 was released yesterday, however, and the bug still exists. I went ahead and created an issue this evening.
Investigating the implementation, I found that the addDefaultTag
function is used to determine the tag for both the default repository as
well as user-specified repositories (that do not already include a tag
or digest). I am not sure what behavior is desired in this case, so I
submitted an example
diff of an implementation that formats tags depending on the LTS
version in both cases. I hope to receive some feedback.