DEV Community

Cover image for Free AWS Bootcamp: Week 1 - App Containerization
Msaghu
Msaghu

Posted on

Free AWS Bootcamp: Week 1 - App Containerization

Hi guys, welcome back to week 2.

This week we will be learning about Docker and containers.

What is a container?

  • An isolated environment for running an application.

  • It can also be described as a running instance of an image.

  • Are more lightweight compared to VMs, as they do not require/or contain a full OS and they use the OS of the host, thus allowing them to start quickly.

  • We need less hardware resources unlike VMs thus allowing us to run even 100s of containers side-by-side.

What is Docker?

  • A platform for building, running and shipping applications and all its dependencies in a consistent manner.

  • Virtual Machines allow us to run applications in isolation inside a VM.

What is the Docker Architecture?

  • Uses the Client-Server Architecture, where the Client talks to the Server(This is the Docker Engine) using a RESTful API.

  • Containers use the Kernel of the Host, and each kernel has its own APIs thus making it hard to run windows applications on Mac and vice versa, however we can run Linux applications natively on Windows due to WSL.

What are the differences between docker desktop and Docker?

  • Docker desktop makes use of a hidden VM(virtual machine)/subsystem depending on your OS or subsystem to run an isolated instance of Docker.
  • Docker then uses the hidden instance to configure a Linux OS with the Docker runtime. Once its installed we will then have the Docker CLI and User Interface.
  • Docker desktop Is segmented from your main OS.

What is a Docker image?

  • A template for creating an environment of your choice i.e a database, a web application, an application.
  • An image is a Snapshot, which is a version of our image.

What is the process of dockerizing an application?

  • This means that we add a Docker file to the application.
  • A dockerfile is a plain text file that includes instructions to package the application into an image.
  • An image contains everything an application needs to run e.g:
  1. A cut-down OS

  2. A runtime environment

  3. Application files

  4. Third-party libraries

  5. Environment variables

  • Then Docker starts a container with the image, thus making a container a process with its own file system.

  • We can then post our application image to Docker hub which can then be downloaded and started on any other machine.

Traditional environment for a JavaScript application

  1. Start with an OS

  2. Install Node (the execution environment for JS code)

  3. Copy app files

  4. Run node app.js

What are Container Volumes?

  • Allows us to share data between host and container or between containers which can be a file or folder.


Key Terms

  1. VM - Virtual Machines
  2. API - Application Programming Interface
  3. Client-Server Architecture - A client can be a web browser or desktop application that a person interacts with to make requests to computer servers. A server can be a type of virtual server.
  4. Kernel - Manages applications and hardware resources eg. memory, CPU.

For example, suppose that a client makes a request for a news article, the score in an online game, or even you clicking the links in the resources below. The server evaluates the details of this request and fulfills it by returning the information to the client.


Resources

Top comments (0)