Mentions légales du service

Skip to content
Snippets Groups Projects
Gözükan Hande's avatar
Gözükan Hande authored
Check inside the container that the python file is no more here

See merge request formations/docker/handsondocker!11
b6b9234b
History

Hands-on Docker

This training aims to give a taste of Docker with a hands-on experience. Docker concepts and its architecture will be explained in their basics. The main objective of this training is to show a complete workflow that could be useful to everyone.

By the end of the course, participants should have a basic understanding of the concepts and some experience with the basic Docker commands that would enable them to assess possible use cases for their own work. More in-depth reading is left to the participants.

The training also includes a short introduction to Docker Compose and demonstrates its usage over a simple use case.

Material

Training material consists of 8 notebooks prepared using Jupyter notebooks and corresponding exercises.

Prerequisites

Programming experience is necessary to be able to follow the training. The examples contain simple Python code and does not require specific Python knowledge.

It is preferable to use a Linux platform.

Installation

Requirements

Docker Engine and Compose plugin installations are necessary to run Docker daemon on localhost and execute Docker client and Compose commands.

Docker Engine is only available for Linux platforms.

For Windows and Mac, Docker can be used through Docker Desktop. Commercial use of Docker Desktop requires paid subscription under certain conditions. For more, refer to how to check your docker installation.

This training will not cover Docker Desktop.

Installation

  • Docker Engine

Please follow the installation instructions for your Linux distribution on Install Docker Engine.

  • Compose plugin

Please follow the installation instructions on Scenario two: Install the Compose plugin.

Optional requirements

This tutorial is prepared using Jupyter notebooks. Use of Jupyter Notebook/JupyterLab together with bash_kernel provides an easy to use and coherent interface. JupyterLab is favored over Jupyter Notebook as it provides a tabbed work area where you can view notebook, terminal and text files side by side.

However use of Jupyter Notebook/JupyterLab and bash kernel is not mandatory. It is possible to view contents of the notebooks online and follow the instructions on your local Terminal command line.

Installation

The optional requirements can be installed using either the environment.yml or the requirements.txt files.

  • environment.yml

    Create handsondocker conda environment:

    conda-env create -f environment.yml

    Activate environment:

    conda activate handsondocker

After running these commands handsondocker conda environment is created and ready to run the notebooks.

  • requirements.txt

    Create .handsondocker virtual environment (Python version should be <=3.11):

    python -m venv .handsondocker

    Activate environment:

    source .handsondocker/bin/activate

    Install the dependencies:

    pip install -r requirements.txt

After running these commands .handsondocker virtual environment is created and ready to run the notebooks.

Use of notebooks

License

"Hands-on Docker" training material by Hande Gözükan is licensed under Creative Commons Attribution-ShareAlike 4.0 International License.

Some of the explanation parts of this material contains modified extracts from docker documentation. These parts are indicated with * in the material and licensed under Apache 2.0 license. You can see copyright notice in LICENSE_AL2 file.