CloudLinuxMachine LearningPython

Building a Machine Learning Docker Container

container

I created a simple machine learning Docker container image for executing small experiments on AWS and Azure.

The container uses Ubuntu 18.04.2 LTS at its core with Python 3 and common Python ML libraries:

  • pandas
  • scipy
  • numpy
  • matplotlib
  • records
  • tensorflow

Machine Learning with Docker Source Code

#Download base image Ubuntu 18.04.2 LTS
FROM ubuntu:latest

# Update Ubuntu Software repository
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y sudo curl lsb-release wget

# Install Python 3 with pip
RUN apt-get install -y python3-pip
COPY requirements.txt .
RUN pip3 install -r requirements.txt

# Environment settings
ENV PYTHONUNBUFFERED 1
RUN echo 'alias py=python3' >> ~/.bashrc
RUN echo 'alias pip=pip3' >> ~/.bashrc

# TODO: Add nvidia-docker once it supports Windows
# https://github.com/NVIDIA/nvidia-docker/issues/429

Also published on Medium.

Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.