🔥 Machine learning Docker images for Ruby
Spin up a machine learning environment in a single command
Start a container
docker run -p 8888:8888 ankane/ml-stack:standard
And visit http://127.0.0.1:8888/?token=...
.
Share a volume with the container
-v /path/on/host:/notebooks
For GPU images, install the NVIDIA driver and container toolkit on the host machine. Then use:
--gpus all
Use a custom container for your notebook. Set the container name to the image you want to use, like:
ankane/ml-stack:torch-gpu
And leave the other fields in that section blank.
Create a Dockerfile
in the root of your repository with the image you want to use and your notebooks:
# Choose an image
FROM ankane/ml-stack:standard
# Remove example notebooks
RUN rm *.ipynb
# Copy your notebooks
COPY Notebook1.ipynb Notebook2.ipynb ./
# The rest is specific to Binder
ARG NB_USER
ARG NB_UID
RUN adduser --disabled-password --gecos '' --uid ${NB_UID} ${NB_USER} && \
chown -R ${NB_USER}:${NB_USER} .
USER ${NB_USER}
RUN mkdir ~/.jupyter && \
echo 'c.KernelSpecManager.ensure_native_kernel = False' > ~/.jupyter/jupyter_notebook_config.py && \
iruby register
Then visit Binder to run it.
There are a few images to choose from:
Tag: standard
Tag: torch-gpu
Designed for deep learning with Torch
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
To get started with development:
git clone https://github.com/ankane/ml-stack.git
cd ml-stack
# build specific images
docker build -f standard/Dockerfile -t ankane/ml-stack:standard .
docker build -f torch-gpu/Dockerfile -t ankane/ml-stack:torch-gpu .