Repo2docker: Add option to skip using a Dockerfile

Created on 17 Aug 2020  路  4Comments  路  Source: jupyterhub/repo2docker

Proposed change

Make using the Dockerfile in the root of the repository an option by providing the means to disable Dockerfile buildpack detection.

Alternative options

Only use Dockerfile.jupyter files to be able to distinct between a docker image delivering just the binary and a Dockerfile that includes all the required notebook dependencies.

Who would use this feature?

This feature would be used by projects that use a Dockerfile as a means of distributing their binary, but don't have a notebook as primary usage interface.

How much effort will adding it take?

It would be as simple as including a new configuration key / file that can be read by the detection mechanism in the docker buildpack class. The alternative option is even easier, but I see some backwards compatibility issues for projects already using the Dockerfile customization.

Who can do this work?

Practically everyone with basic python knowledge. But I reckon we should discuss pros and cons first.

discussion

Most helpful comment

You can "hide" a Dockerfile from repo2docker by creating a .binder/ or binder/ sub-directory (that could be empty). As soon as one of those directories exists repo2docker will only look for files in it to decide which build pack to trigger.

Would that work for your use-case?

All 4 comments

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:

Welcome to the Jupyter community! :tada:

You can "hide" a Dockerfile from repo2docker by creating a .binder/ or binder/ sub-directory (that could be empty). As soon as one of those directories exists repo2docker will only look for files in it to decide which build pack to trigger.

Would that work for your use-case?

It does work, however, this will make repo2docker skip building dependencies from requirements.txt or environment.yml located in the project root. I can see this working as intended so feel free to close the issue if that is the case.

Yes that is a side-effect. Once one of the sub-directories exist the top level directory is ignored. This allows you to "hide" not only a Dockerfile but also environment.yml etc files. Most of the time when people create a sub-directory for the binder specific dependencies this is what they want. If you want to re-use a file from the top level directory sym-linking it from binder/ works well to avoid duplicating the content.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

consideRatio picture consideRatio  路  6Comments

sje30 picture sje30  路  3Comments

HeidiSeibold picture HeidiSeibold  路  4Comments

Morisset picture Morisset  路  5Comments

nuest picture nuest  路  6Comments