Lab 4: Overview

Table of Contents

You’ve learned how to start a Docker container using docker run and docker-compose. In each instance, we used an existing image from Docker Hub to create the container. We had a problem with the Wordpress image because the image itself did not support SSL. Now, we need to learn how build our own images using docker build.

Docker Build

We will build an image from a Dockerfile. The file contains the set of instructions or commands that user would type into a shell session to configure a server. However, the process in 100% automated. The Dockerfile contains all of the information necessary to configure the image so that it can start as a container in a preconfigured state.

  1. First, we will build an image using preconfigured Dockerfile.

  2. Then, we will modify the file to include additional configurations or functionality.

Sphinx and Read The Docs

We will build a customer Docker image to run Sphinx that uses Read the Docs Sphinx Theme. Sphinx is a documentation generator that converts reStructuredText (RST, ReST, or reST) files into HTML websites and other formats including PDF, EPub, and Texinfo. Read the Docs is a platform for hosting documentation.

Sphinx was original designed to create documentation for Python project. It has been extended and to other languages and to host content written in reStructuredText. We will use Sphinx to render ReST files to put content on a website. Writing ReST files takes time, but your might find this format suitable for your own documentation or instructional guides.

This site uses Sphinx with Read the Docs theme. You can view raw .rst files by click the View page source at the top each page.


  1. Getting Started with Sphinx

  2. Sphinx’s reStructuredText primer

Goals for Lab 4

This lab demonstrats how to build an impage from an existing Dockerfile.

During this lab, you will learn how to:

  1. install Sphinx and ReadTheDocs plugin to understand the installation process

  2. clone a project on Git hub

  3. build a Docker image from a Dockerfile

  4. modify a Dockerfile to create a modified version of the image

  5. write reStructuredText (RST, ReST, or reST) files