Version 0.2.3 of ContainDS adds ‘Local Folder’ as a dropdown option in the Binder tab when creating a new container. You can browse for the folder or just enter the full path directly:
This requires that the folder contains a Binder-ready source tree, meaning it must have: the notebooks and/or data for your project, and also a requirements.txt or environment.yml file etc describing the dependencies that make up the necessary environment.
Mounting the local folder
If ‘Mount local folder as the workspace’ is checked, then when the container is ready the workspace folder will be a mount of the local folder on your hard drive – so any changes made to your notebooks or data within the container will be immediately visible on your hard drive folder and vice versa.
If ‘Mount local folder as the workspace’ is unchecked then a copy of the local folder’s files will be made at the time when the container is built, and this copy will be independent of the original local folder going forward. To changes made to the files inside the container will not be seen in the original local folder. This is an ‘integrated workspace’.
ContainDS will build a new Docker image each time you select the same local folder in the Binder tab provided it detects changes to the local folder’s file tree (excluding files starting with a dot). It will also maintain separate images for mounted/unmounted Binder runs where the ‘Mount local folder as the workspace’ is checked/unchecked. If the files are unchanged then it will reuse the existing image.
It is possible to directly select a cached image to be used for a container, without using the Binder interface. To do that, click on the Docker tab in the ‘+ NEW’ container screen (instead of the Binder tab) and click on the Local Images tab. Your cached Binder images should be visible. If you click ‘SELECT’ on an image then the new container configuration screen should display information messages and defaults that remind you whether the image was created in ‘mounted’ or ‘unmounted’ mode.
Generally, it will make sense to respect the conditions under which the image was created, but it is possible to separate the environment from the workspace at this point. A local folder Binder that was originally mounted can be recreated as an integrated workspace – and this should start with the workspace files as they were at the time the image was created. An originally-unmounted Binder image can be connect to a live workspace on your hard drive, in which case the files that were initially copied from the local folder into the integrated workspace will be hidden.