Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Docker Essentials For Python Developers

Docker Essentials For Python Developers

Docker and containerisation can be confusing technologies if you haven't spent much time in the containerization and virtualisation space. This talk covers core Docker concepts such as images, containers, and Dockerfiles.

It presents a simple and easy-to-follow introduction to Docker and shows how to apply the concepts to Dockerise Python applications.

Vuyisile Ndlovu

October 31, 2024
Tweet

More Decks by Vuyisile Ndlovu

Other Decks in Programming

Transcript

  1. TODAY, YOU’LL LEARN • What Docker is • Why we

    need it • Core Docker concepts • Practical Demo: Dockerising a Python application • Building and running a Docker container • Tips and best practices for running containers
  2. Without Docker • Setting up environments hard • Dependency problems

    in different OSes • Difficult for teams not familiar with your stack @terrameijar | vuyisile.com/pyconzim24
  3. @terrameijar | vuyisile.com/pyconzim24 - Cake Premix contains: - Baking instructions

    - Ingredients to bake a cake - Produces consistent and predictable results CAKE PREMIX
  4. docker image build • Builds a Docker image based on

    a Dockerfile @terrameijar | vuyisile.com/pyconzim24
  5. docker container run • Convert an image into a container

    and start it @terrameijar | vuyisile.com/pyconzim24
  6. Docker Best Practices @terrameijar | vuyisile.com/pyconzim24 1. Multi stage builds

    2. Use small Docker Base Images 3. Use unprivileged containers 4. Prefer exec form over shell form for running CMD, ENTRYPOINT i.e CMD ["--host", "0.0.0.0", "--port", "8001"]