-
Notifications
You must be signed in to change notification settings - Fork 15
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
Examples #4
Comments
I don't think most of the Dockerfiles that I write satisfy these conditions, to be honest (and ironic)! Maybe one that has a few (cleaning up, small reliable base, multistage build, label) would be https://github.com/singularityhub/singularity-docker/blob/v3.5.3-slim/Dockerfile. |
In my own dabblings, I've started forsaking Dockerfiles and moving to REES / MyBinder builds ( The most complex setups I did were still quite simple, for personal use only, and tended to use The other extreme are really simple single app containers, which I guess could be interesting trying to "bring up to spec" (candidate example?. The most complex single container builds I done have also tended to be experimental in the way I've constructed them, essentially based on a flakey "stack" model (example). FWIW, I'm happy for any of the Dockerfiles I've created to be used as examples of bad practice (I tend to share all my work in progress because the bad practice / errors are useful reference points when it comes to writing teaching materials ("pragmatically, you might think you should do X, because Y, but actually, that sucks because Z". (My own work rarely gets past Y...;-)) I also note that a lot og good practice comes from good habits, eg always starting a file with X (eg some metadata) always finishing it with Y (an example of usage for example) which can come from good cookie cutters / templates and, if you use them (auto)linters. |
@vsoch The fact that most of the Dockerfiles won't satisfy the conditions is the idea behind have "before and after" in the examples directory. @psychemedia Thanks for the example links, especially if you consider them "bad" practice (though they worked for you, right?). Will you rewrite them yourself to demonstrate the rules? |
https://github.com/sje30/eglen2015/blob/master/Dockerfile (suggested by @sje in #6 (comment)) |
Candidate for rewrite: https://science.sciencemag.org/content/suppl/2020/04/22/368.6489.420.DC1 is a supplement to a paper with a Dockerfile and even an image tarball. |
@psychemedia I took a look at the Ergast F1 example, and don't think it is a good fit for a rewrite because the goal seems to be a job for regularly updating a copy of a database. I did a review of the OpenRefine Dockerfile, let me know what you think: #75 Checklist for me (or anyone who gets to them first):
|
Here is a nice example of how to use target for multistage builds, although I've never done one like that. https://www.hackdoor.io/articles/1vpakaJw/docker-multi-stage-build-to-create-optimal-images-for-dev-and-production |
I'm working on https://github.com/neural-reckoning/vcn_regularity/blob/master/Dockerfile from the list above and will have it by the end of the week. |
Thanks @bdevans - I was just about to start with that one :-) Will instead spend some time on https://github.com/nuest/docker-qgis-model/ and https://science.sciencemag.org/content/suppl/2020/04/22/368.6489.420.DC1 |
Hi @nuest, so I applied the rules to the VCN regularity Dockerfile last night and then found out that the original no longer builds (could be due to disappearing Python 2 libraries or a change in the conda dependency solving algorithm). Presumably you only want Dockerfiles that build included in the examples, right? If so, do you have any other good candidates in mind to work on instead? It also occurred to me that it could be nice to have a no-Dockerfile example i.e. demonstrate Rule 1 by reducing an existing Dockerfile to a simple |
I have a "no dockerfile" example already if it is helpful:
https://github.com/sje30/rescience-hor
… Hi @nuest, so I applied the rules to the VCN regularity Dockerfile last night and then found out that the original no longer builds (could be due to disappearing Python 2 libraries or a change in the conda dependency solving algorithm). Presumably you only want Dockerfiles that build included in the examples, right? If so, do you have any other good candidates in mind to work on instead? It also occurred to me that it could be nice to have a no-Dockerfile example i.e. demonstrate Rule 1 by reducing an existing Dockerfile to a simple `environment.yml` for use with Binder. What do you think?
|
Hi @bdevans It would be nice if they build, but if you make it clear in the corresponding README why it does not build, and can point out how to avoid that problem as much as possible in the "updated" verison, then I'd say it is useful to include. I really like the idea to have examples for Rule 1! 👍 That should be pretty straightforward for the VCN example as they already have a Binder button, right? I think the repo predates some features that MyBinder has today. |
@sje30 The repo https://github.com/sje30/rescience-hor is already the "after", right? Can you point to some supplemental material where there is the "before" state? I think then we can just have a |
Ok, I'll submit a PR with the revamped Dockerfile (and other minor edits for now) but happy to take a look at replacing it with a no-Dockerfile example once Dan and I upgrade everything to work again. |
@nuest there was no before! but given that we are talking about not writing a dockerfile, it is okay I think. |
It would be great to supplement the articles with real-world examples, e.g. by putting them into this repository and also inviting the scientific community to contribute more via pull requests.
@sje30 suggested "before and after" comparisons of Dockerfiles (#16 (comment)), which I really like!
The
examples
directory is open for these.Note: more examples are always welcome, just leave a comment below.
Other ways to find examples:
The text was updated successfully, but these errors were encountered: