Uploaded August 2021 | Updated September 2026, 2 weeks ago
This video tutorial I will talk about how to dockerize Machine Learning (ML) model and will help you to build your first #Docker image and run a Docker container for your Machine Learning project, supposing you are a Data Scientist, Machine Learning (ML) Engineer or aspiring to become a Master of Data Science. This lesson extends your data science knowledge by touching Docker from a Machine Learning perspective. At the end of this Docker lesson you will be able to:
1. Create your Docker image
2. Run your Docker container in the Docker Dashboard tool.
3. Improve your Docker image with your customized working directory.
4. Make your Docker image more stable by using Environmental variables, which could be integrated across the Python codes and the Docker Image itself.
Building-up Docker Images and Docker containers are very important skills for Data Scientists, Developers, and Machine Learning Engineerings who work with Machine Learning Operations (MLOps) tasks.
Pay special attention on how to correctly build a simple #Dockerfile and what main parts must be defined there. How to use COPY, RUN, and other standard functions there, and also how to use default terminal functions inside Dockerfile. This is very important.
Also, it can be highlighted that in this example I used a scipy-notebook image as the base image to build a Docker container, and then a standard jovyan notebook user for our image. You can read more about jovyan here: discourse.jupyter.org/t/what-is-with-the-weird-jovyan-user/1673
In order to start building a Docker container for a Machine Learning model, let’s have three files: Dockerfile, train.py, inference.py.
I highly recommend to download project files and Docker Dashboard tool while following the steps introduced in the video:
- Download all project files from Github here: github.com/xaviervasques/EEG-letters
- Download the Docker Dashboard (for both Windows or Mac) Tool: docs.docker.com/desktop
This tool allows you to push your Docker Containers into DockerHub, share it to the Public and explore your Docker images within user friendly interface.
The content of the Docker lesson:
0:00 Introducing lessons, requirements to complete it
1:14 Your first Docker image. Main commands and Python project codes
6:05 Improve Docker Image with default working directory (WORKDIR)
9:23 Make your Docker Image with Environmental Variables
16:19 Conclusions
In this example I am using the Mac operating system and use simple terminal functions within it.
So, all in all, within this tutorial you will create three different Docker images with containers and will run all of them separately, by integrating two Machine Learning models (Linear Discriminant Analysis - LDA, and Neural Networks - NN) into them. I tried to make this tutorial as clean as possible. If you have any questions, drop a comment below.
#dockercontainer
This video tutorial I will talk about how to dockerize Machine Learning (ML) model and will help you to build your first #Docker image and run a Docker container for your Machine Learning project, supposing you are a Data Scientist, Machine Learning (ML) Engineer or aspiring to become a Master of Data Science. This lesson extends your data science knowledge by touching Docker from a Machine Learning perspective. At the end of this Docker lesson you will be able to:
1. Create your Docker image
2. Run your Docker container in the Docker Dashboard tool.
3. Improve your Docker image with your customized working directory.
4. Make your Docker image more stable by using Environmental variables, which could be integrated across the Python codes and the Docker Image itself.
Building-up Docker Images and Docker containers are very important skills for Data Scientists, Developers, and Machine Learning Engineerings who work with Machine Learning Operations (MLOps) tasks.
Pay special attention on how to correctly build a simple #Dockerfile and what main parts must be defined there. How to use COPY, RUN, and other standard functions there, and also how to use default terminal functions inside Dockerfile. This is very important.
Also, it can be highlighted that in this example I used a scipy-notebook image as the base image to build a Docker container, and then a standard jovyan notebook user for our image. You can read more about jovyan here: discourse.jupyter.org/t/what-is-with-the-weird-jovyan-user/1673
In order to start building a Docker container for a Machine Learning model, let’s have three files: Dockerfile, train.py, inference.py.
I highly recommend to download project files and Docker Dashboard tool while following the steps introduced in the video:
- Download all project files from Github here: github.com/xaviervasques/EEG-letters
- Download the Docker Dashboard (for both Windows or Mac) Tool: docs.docker.com/desktop
This tool allows you to push your Docker Containers into DockerHub, share it to the Public and explore your Docker images within user friendly interface.
The content of the Docker lesson:
0:00 Introducing lessons, requirements to complete it
1:14 Your first Docker image. Main commands and Python project codes
6:05 Improve Docker Image with default working directory (WORKDIR)
9:23 Make your Docker Image with Environmental Variables
16:19 Conclusions
In this example I am using the Mac operating system and use simple terminal functions within it.
So, all in all, within this tutorial you will create three different Docker images with containers and will run all of them separately, by integrating two Machine Learning models (Linear Discriminant Analysis - LDA, and Neural Networks - NN) into them. I tried to make this tutorial as clean as possible. If you have any questions, drop a comment below.
#dockercontainer










