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:
- We start from a base image, which is the basic Python image that is based on Debian:
FROM python:3.8
- We install useful packages that will particularly be used during the installation process of OpenCV and other dependencies:
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
...