@hpdempsey forwarded me a thread that included a pointer to this image, and I wanted to leave a couple of comments on the structure of the Containerfile:
Lose the MAINTAINER field. The answer to "who maintains this?" should be git log; naming a single person as the maintainer discourages collaboration and can cause confusion if people fork the repository without updating that field.
Fedora deprecated the packager field in RPM packaging some time ago for exactly these reasons.
If you want to ensure the generated image contains a link back to the source repository, consider adding an appropiate LABEL of some sort that contains the repository URL.
When you install packages, if you list them one-per-line this will lead to more meaningful diff output. Compare:
The first method allows dependencies to be calculated once, whereas the second method requires dependencies to be calculated multiple times.
Automate image building.
Rather than requiring people to build images manually, include a workflow in the repository that will build the image, tag it, and push it to an image registry. There's an example of such a workflow here; that uses the GitHub container registry (ghcr.io) because it's easy, but one could apply the same technique for other registries as well.
This can also be helpful if folks are unable to build images locally for whatever reason.
@hpdempsey forwarded me a thread that included a pointer to this image, and I wanted to leave a couple of comments on the structure of the Containerfile:
Lose the
MAINTAINER
field. The answer to "who maintains this?" should begit log
; naming a single person as the maintainer discourages collaboration and can cause confusion if people fork the repository without updating that field.Fedora deprecated the
packager
field in RPM packaging some time ago for exactly these reasons.If you want to ensure the generated image contains a link back to the source repository, consider adding an appropiate
LABEL
of some sort that contains the repository URL.When you install packages, if you list them one-per-line this will lead to more meaningful
diff
output. Compare:With:
(I've used
yum
as an example here, but this also applies topip
,conda
, etc.)Install packages in batches rather than individually.
In most cases, this:
Is much faster than:
The first method allows dependencies to be calculated once, whereas the second method requires dependencies to be calculated multiple times.
Automate image building.
Rather than requiring people to build images manually, include a workflow in the repository that will build the image, tag it, and push it to an image registry. There's an example of such a workflow here; that uses the GitHub container registry (ghcr.io) because it's easy, but one could apply the same technique for other registries as well.
This can also be helpful if folks are unable to build images locally for whatever reason.