Examples

This document lists example use cases for Docker Interface that are available on GitHub. Additional, comprehensive examples can be found in the tests.

cython

This simple example addresses some of the difficulties associated with using cython and di together: the cython code is compiled when the Docker image is built. But when the workspace is mounted in the container, the binaries are hidden and the code can no longer be executed. We thus use pyximport to compile the cython code on the fly. See cython_example/__init__.py for details.

notebook

This example demonstrates automatic port forwarding for the Jupyter notebook using di. Port forwarding is implemented using the JupyterPlugin in docker_interface/plugins/python.py.

ports

This example demonstrates how to forward ports using di’s declarative syntax.

env

This example demonstrates that a default environment variable is set whe using di run.