reading-notes

reading notes for code fellows


Project maintained by dLeigh01 Hosted on GitHub Pages — Theme by mattgraham

Django REST Framework and Docker

Docker is going to be an important aspect of our work because it will allows us to use things in a contained manner that aren’t involved in Python.

Beginner’s Guide to Docker

Docker is a program used to isolate and run entire applications, which allows you to avoid needing to use virtual environments at the cost of being a bit more complex to work with. Docker is made up of Linux containers, which are a type of virtualization. Containers are different from virtual environments because they can isolate more than just python packages and can run a production database.

To inspect Docker, you can use docker info to get a lot of information, but mostly you want it for the view of the containers you have. From there, you can inspect the different containers individually. Within Docker, there are two major concepts, containers and images. An image is a snapshot of what a project contains and a container is a running instance of the image. There are many official images hosted on the Docker site, but you can also create your own. Defining an image is similar to creating a requirements.txt file, in that it lists all the necessary requirements to build the image. The first thing in a Docker file must be the FROM command, which imports a base image to build from. Every image is made up of one or more layers, the base one often being a flavor of Linux. Each layer is immutable, and once Docker knows the steps in each layer it will build faster from then on. For that reason, order matters in Docker files, as changing one thing within the imaged means it needs to re-execute the rest from scratch and will take more time. For this reason, the images that are least likely to change should be run first, so they won’t have to be recreated every time the program is executed.

Things I’d Like to Know More About

The second reading for today mentioned the Django REST framework, but didn’t get into it, and I’d like to know about how it works.

Discussion

Docker’s abilities are like an extended version of virutal environments.

[< table of contents]

[< home]