-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let us template the Dockerfiles #6
Conversation
generate.hs
Outdated
{-# LANGUAGE OverloadedStrings, RecordWildCards #-} | ||
-- | Script to generate dockerfiles. Obviously using Haskell. | ||
-- | ||
-- If you have @cabal-env@ installed, do: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about declaring the deps via a cabal metadata block?
i.e. https://cabal.readthedocs.io/en/latest/nix-local-build.html#cabal-v2-run
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can cabal v2-repl
pick up them as well? as far as it cannot, the development experience is very poor. With cabal-env
I can ghci/ghcid the module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this issue: haskell/cabal#6149
EDIT: the dependency solving on each iteration just takes too long time for the development. Fine when you run it once, but now this script will be (hopefully) evolving.
@psftw any opinions on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not against templating, but I don't think it is justified yet. There should also be instructions on how to run this in a consistent way, ideally without needing to bootstrap additional tooling.
8.8/Dockerfile
Outdated
@@ -1,5 +1,5 @@ | |||
## Dockerfile for a haskell environment | |||
FROM debian:stretch | |||
FROM buildpack-deps:stretch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to be clear about why this was changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buildpack-deps
seems to be the source for all/most other non-slim official images. It includes most common development tools and c-dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I carefully reviewed all packages that get installed in this image, and I'm aware that some overlap with buildpack-deps
. Before merging a change like this I would like to know exactly what it gets us, and for the overlapping package installs to be removed from this Dockerfile to avoid confusion. I could look it up and do this analysis, but the burden is on you to make the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slim
version uses your list, non-slim uses buildpack-deps
which has all the packages except the libtifno-dev
.
I think libtinfo-dev
should be pulled in by ghc
packages, @hvr is it still not the case?
Dockerfile.template
Outdated
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git && \ | ||
echo 'deb http://downloads.haskell.org/debian stretch main' > /etc/apt/sources.list.d/ghc.list && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"stretch" is probably intended to be a template variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
19030a0
to
9692e3c
Compare
I pushed a new variant, I still need to write the instructions how to regenerate. I think with EDIT: note, this already includes |
9692e3c
to
3495a78
Compare
Taking a quick pass at the latest iteration -- 8.4.x is effectively frozen, so let's not make any changes there. Per docs,
I'm strongly against downgrading to checksums when we have GPG keys. Related: #4 I'm souring on the direction these changes are taking. There is a history of being conservative and avoiding unnecessary complexity in this project. GHC is not released very often and we have only needed to maintain two Dockerfiles at any given time. Before releases I run the images through an informal battery of tests and review the results manually. This has scaled well enough to date without any major hiccups, but won't suffice as we expand to more platforms/variants. A more formal CI suite is in order. OK, hope this doesn't come across too harshly. I really am open to expanding the matrix and using Haskell to do the Dockerfile generation, but it will need to be done in the right spirit of the project as outlined above. |
Which uses jinja2 inspired syntax, which is well known. I can change to mustache if it feels better.
Well, it did. You asked for maintenance help, I offered some.
I didn't know that. From my perspective I would need images with newest versions of tools ( Feel free to remove me from this repository. |
No description provided.