Skip to content

Commit

Permalink
Add Dockerfile (#273)
Browse files Browse the repository at this point in the history
* Add Dockerfile

* Add .dockerignore
  • Loading branch information
vuolleko committed Jun 20, 2018
1 parent 78a3c5b commit 1352ee4
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 0 deletions.
106 changes: 106 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# IDE settings
.idea

# Byte-compiled / optimized / DLL files
**/__pycache__
*.py[cod]
*$py.class

# C/C++ extensions
*.so
*.bin

# Distribution / packaging
.Python
env
build
develop-eggs
dist
downloads
eggs
.eggs
lib
lib64
parts
sdist
var
*.egg-info
.installed.cfg
*.egg

# Images
*.png
*.svg
*.jpg
*.jpeg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*cover
.hypothesis

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build

# PyBuilder
target

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv
ENV
.venv

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# Editor temp files
*~
*.swo
*.swp

16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM python:3.6

RUN apt-get update && apt-get install -y graphviz

WORKDIR /elfi
ADD . /elfi

RUN pip install numpy graphviz
RUN pip install -e .
RUN pip install -r requirements-dev.txt

# matplotlib unable to show figures
RUN mkdir -p /root/.config/matplotlib
RUN echo "backend : Agg" >> /root/.config/matplotlib/matplotlibrc

CMD ["/bin/bash"]
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ source activate elfi
pip install elfi
```

### Docker container

A simple Dockerfile for command-line interface is also provided. Please see [Docker documentation](https://docs.docker.com/).

```
git clone --depth 1 https://github.com/elfi-dev/elfi.git
cd elfi
docker build -t elfi .
docker run -it elfi
```

### Potential problems with installation

ELFI depends on several other Python packages, which have their own dependencies.
Expand Down
13 changes: 13 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,16 @@ means the current folder.
.. _Github repo: https://github.com/elfi-dev/elfi
.. _tarball: https://github.com/elfi-dev/elfi/tarball/dev

Docker container
----------------

A simple Dockerfile for command-line interface is also provided. Please see `Docker documentation`_.

.. _Docker documentation: https://docs.docker.com/

.. code-block:: console
git clone --depth 1 https://github.com/elfi-dev/elfi.git
cd elfi
docker build -t elfi .
docker run -it elfi

0 comments on commit 1352ee4

Please sign in to comment.