Week#8(Containerization)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

API Engineering

Yin Hua Li
Centennial College

Week#8 2024Fall

Topic: Containerization

1
¡ Traditionally, software is developed in a specific computing environment, when
it is transferred to a new environment , often results in bugs and errors.
Containerization is introduced to eliminate this problem.
¡ Containerization is to package software code, related configuration files,
libraries and all its dependencies so that it can run on any infrastructure

From https://hackernoon.com/what-is-containerization-83ae53a709a6 2
¡ Containerization and virtualization are the two most frequently used
mechanisms to host applications in a computer system , both have pros
and cons
§ Virtualization uses virtual machine as the fundamental unit
§ Containerization uses the concept of a container
¡ For more of comparison, watch the video here

From https://hackernoon.com/what-is-containerization-83ae53a709a6
3
¡ Docker
¡ AWS Fargate
¡ Google Kubernetes Engine
¡ Amazon Elastic Container Service (ECS)
¡ Linus Containers (LXC)
¡ Container Linux by CoreOs
¡ Microsoft Azure
¡ Google Cloud Platform
¡ Portainer
¡ Apache Mesos
https://www.softwaretestinghelp.com/container-software/ 4
¡ Container has been exploded in popularity with
the introduction of Docker Engine in 2013.
Because of that, “containerizing” and
“Dockerizing” are often used interchangeably

¡ A container is a process that has been isolated


from all other processes on the host machine

¡ Docker is an open platform that provides the


ability to package and run an application in a
container
5
¡ Docker Objects
§ Docker Image: A Docker image is an immutable file containing the
source code, libraries, dependencies, tools, and other files that are
required for an application to run
§ Docker container: a docker container is a running instance of an
image. It is defined by its image as well as configuration options
when it is created or started
¡ Docker Daemon
§ It listens for Docker API requests and manages Docker objects
¡ Docker client
§ It is used to interact with Docker. When you issue a command (e.g.,
docker run), the client sends the command to dockerd
¡ Docker registry
§ Stores Docker images. Docker Hub is a public registry. By default,
Docker is configured to look for images on Docker Hub.
§ You can use other registry, such as AWS Elastic Container Registry
6
Source: https://learning.oreilly.com/library/view/docker-deep-dive/9781835884386/
7
¡ Docker uses client-server architecture
¡ The Docker client and daemon communicate using
RESTful API over Unix sockets or a network interface

From https://docs.docker.com/get-started/docker-overview/ 8
9
10
11
¡ Watch these videos
§ https://www.youtube.com/watch?v=vmnvOITMoIg&list=PLdo4fOcmZ0oUvXP_Pt2zOgk8dTWagGs_P&index=1
§ https://www.youtube.com/watch?v=SjqBCRn-XnI

12
13
docker build -f Dockerfile ..

Dockerfile

14
docker build -f Dockerfile ..

¡ What is a Dockerfile?
§ Docker builds images automatically by reading the instructions from a
Dockerfile which is a text file that contains all commands, in order, needed
to build a given image.
§ A Dockerfile adheres to a specific format and set of instructions which you
can find at Dockerfile reference.
▪ https://docs.docker.com/engine/reference/builder/
Set up base image with aspnet runtime

Use full sdk as build stage

Restore packages and build project

Alias build as publish and run dotnet publish

Copy published files into final image with


Just the runtime on it 15
docker build -f Dockerfile ..

16
¡ https://blog.netapp.com/blogs/containers-vs-vms/
¡ https://www.ibm.com/cloud/learn/containerization
¡ https://www.baeldung.com/cs/virtualization-vs-containerization
¡ https://hackernoon.com/what-is-containerization-83ae53a709a6
¡ https://builtin.com/software-engineering-perspectives/containerization
¡ https://www.softwaretestinghelp.com/container-software/
¡ https://docs.docker.com/get-started/overview/
¡ https://www.youtube.com/watch?v=3c-iBn73dDE&t=7s
¡ https://learn.microsoft.com/en-us/visualstudio/containers/container-tools?view=vs-2022

17

You might also like