Defining a Dockerfile

Instructions in the Dockerfile start from a base image, and then desired installations and modifications are done on top of that image.

At the time of writing, TensorFlow does not support Python 3.8. If you plan to run Chapter 7, Learning to Recognize Traffic Signs, or Chapter 9, Learning to Classify and Localize Objects, where TensorFlow is used, you can start with Python 3.7 and then install TensorFlow with pip, or you can pick tensorflow/tensorflow:latest-py3 as the base image.

Let's go over the steps to create our environment:

  1. We start from a base image, which is the basic Python image that is based on Debian:
FROM python:3.8
  1. We install useful packages that will particularly be used during the installation process ...

Get OpenCV 4 with Python Blueprints - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.