Skip to content

🐳 An all-in-one Docker image for machine learning. Contains all the popular python machine learning librairies (scikit-learn, xgboost, LightGBM, gensim,Keras, etc...).

License

nielsborie/machine-learning-environments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

88 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

machine-learning-environments

πŸ‘· CI πŸš€ Release πŸ€– Stable πŸ§ͺ Snapshot
GitHub CI GitHub release LATEST SNAPSHOT

An all-in-one Docker image for machine learning.

logo

Specs

This is what you get out of the box when you create a container with the provided image/Dockerfile:


Setup

Prerequisites

Install Docker following the installation guide for your platform: here


Obtaining the Docker image

  • Option 1: Download the Docker image from Docker Hub

Available here : (https://hub.docker.com/r/nielsborie/machine-learning-environments/)

docker pull nielsborie/machine-learning-environments
  • Option 2: Build the Docker image locally

  1. clone the repository
git clone https://github.com/nielsborie/machine-learning-environments.git
cd /machine-learning-environments
  1. basic building :
docker build . -t machine-learning-environments
  1. If you have a proxy issue execute the following line :
docker build . --no-cache --force-rm --build-arg http_proxy=<proxy> --build-arg https_proxy=<proxy> --build-arg no_proxy=localhost,<proxy>,<proxy>,.an.local -t machine-learning-environments

Running the Docker image as a Container

Once we've built the image, we have all the frameworks we need installed in it. We can now spin up one or more containers using this image.

Note:

  • This images is based on jupyter-tensorflow docker.
  • By default the image automatically launches a jupyter notebook on port 8887 of your localhost.

jupyter

  • Basic run

Simplest command to launch the container.

docker run --name ML-env -p 8887:8888 nielsborie/machine-learning-environments

docker_run

If you don't want to be stick to your terminal, you can run it in detached mode (-d)
docker run --name ML-env -d -p 8887:8888 nielsborie/machine-learning-environments
  • Start & Stop

Once you create the container, all you need to do is launch it :

docker start ML-env
docker stop ML-env
  • Enter in the running container

Since you launched the container, you can get in and be root inside the image!

docker exec -it ML-env /bin/bash

docker_root

  • Customize your Container

  • If you want a real password (and avoid copy/paste token step...)
docker run --name ML-env -d -p 8887:8888 -d nielsborie/machine-learning-environments start-notebook.sh --NotebookApp.password="sha1:b6dba7097c97:7bded30fcbd5089adb3b63496d5e68921e102a5f" 

Note:

  • default password = admin
  • If you want to share your current working folder, you can map it with "-v" or "--volume"
docker run --name ML-env -p 8887:8888 -d -v /sharedfolder:/home/jovyan/work/ -e NB_UID=<your-UID> --user root nielsborie/machine-learning-environments start-notebook.sh --NotebookApp.password="sha1:b6dba7097c97:7bded30fcbd5089adb3b63496d5e68921e102a5f"
Parameter Explanation
-it This creates an interactive terminal you can use to iteract with your container
--name This set a name to our container, in our case we use ML-env but you can change it
-p 8887:8888 This exposes the ports inside the container so they can be accessed from the host. The format is -p <host-port>:<container-port>. The default jupyter notebook runs on port 8888
-v /sharedfolder:/root/sharedfolder/ This shares the folder /sharedfolder on your host machine to /home/jovyan/work/sharedfolder/ inside your container. Any data written to this folder by the container will be persistent. You can modify this to anything of the format -v /local/shared/folder:/shared/folder/in/container/
-e NB_UID=<your-UID> --user root This fix permission issues under the container, you need to replace with your UID. You can get it with : id -u
nielsborie/machine-learning-environments This the image that you want to run. The format is image:tag. In our case, we use the image machine-learning-environments and tag latest
start-notebook.sh --NotebookApp.password It allows to launch the jupyter with a password already configured to admin

If you need to change the password check :

Jupyter notebook documentation

You can find additionnal info here :

Jupyter docker documentation


About

🐳 An all-in-one Docker image for machine learning. Contains all the popular python machine learning librairies (scikit-learn, xgboost, LightGBM, gensim,Keras, etc...).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published