Sunday, April 23, 2023

SIMILARITIES OF PRIVATE & PUBLIC CLOUD

 







Today, we will buttress on the main  instrument in cloud.

 VIRTUALIZATION : Before Virtualization there was nothing like cloud. Virtualization gave birth to cloud which makes cloud computing possible. The reason is because, the word virtual which means, you have the ability to make available particular resources to be consumable via the network through the API CALLS. It can either public or private network. 

It all started with private data centres/cloud. Public cloud did not exist before private cloud.  Organization took advantage of virtualization to have that flexibility when it comes to partitioning and allocating resources as needed and efficiently utilizing the resources they had on-ground with the USE OF  HYPERVISOR. Even though they're in the private cloud sector  they still manage all the different appliances within the physical data centre, they needed the physical F5 LOAD BALANCER , FIREWALLS etc. All these falls within the loop of expenses. 

For example: 

Another organization wants to host an application which probably will be lunched in Europe. You have to factor to set-up a data centre in the EU which comes with certain limitations like capital. This is when big organizations like GOOGLE, MICROSOFT leverage the virtualization to a network structure which is spread across the globe via the open INTERNET. And provide some security services to be able to secure their resources virtually by integrating different technology.This is how public cloud existed. 

You give people the opportunity to consume those same virtual resources via the internet not through the co-operate network. However, the fact that you can access through the internet does not mean its not secure thats where most companies are skeptical when it comes to that. Google cloud has developed a  robust technology which you can use to protect your environment and improve on your security posture as and make it even better as compare to someone that running the private data centres. 

Today, Government agencies are adopting cloud. Due to its security postures. 


PHYSICAL DATA CENTRE.




In our next slide, we will discuss the six pillars of GCP  framework!Happy Learning😊!!

Saturday, April 22, 2023

CHALLENGES IN CLOUD


 

We will discuss some challenges which 80% of organization that are still operating some kind of IT system or resources is on-premises face. And this is based on google analysis. Let's talk a look at the pool of companies that have some type of application that they are running , majority are still in that private data centre, physical location and managing workload. That is what has triggered massive disruption of  CLOUD. 

Today, GCP provides various services to solve the on-premise challenges. 

On-premises : It is difficult to estimate the workload capacity. Meaning the amount of resources that you will need to be able to manage your workload. Hence, Google cloud provides you a services which allows you to ONLY pay for what is used. 

Based on your experience as a cloud expert can you tell me some of the difficulties your client face on-premise which literally makes them to start migrating to cloud or using GCP. 

On-premises : Its not possible to go global in minutes with GCP you can reproduce the infrastructure in multiple regions within minutes. GCP uses automation in achieving this. 

On-premises: The security another concern, however, GCP is highly secured that means each services within the network environment has its own security and some of the features will be maintenance and centralized management.  

On-premises: Is expensive to manage, the software are installed and runs on a company's own hardware infrastructure and hosted locally. whereas GCP optimize cost, the software is stored and managed on the providers servers and accessed through the web browser or other interface. 


In our next slide, we will discuss about deployment models!Happy Learning😊!!

Thursday, April 20, 2023

GCP SERVICE MODEL





 The service model has to do with the public cloud providers. How you choose a particular service depending on what you want to accomplish on the platform. 

There three key domains when it comes to compute, storage, network, database and so on. When it comes GCP, and you have a particular application you want to deploy, as a sophisticated engineer you will decide how much effort you're ready to put into the project as well as the flexibility.

Effort: You can decide that, you do not want to manage the application or environment within GCP, probably because the organization do not have the expertise or they do not have the actual bandwidth allocated for the workload. So you want a service that provides some  MANAGED CAPABILITIES in that case, your decisions will be affected based on how much effort you want to put into the project.

Flexibility: This has to do with the different changes from the base to the top configuration which you want to introduce within the actual deployment application in your environment. for example, Google Cloud can maintain and manage the actual compute layer and so on. With this your decisions will be affected based on how much flexibility with regards to your workload management. 

    THERE ARE FIVE SERVICE MODELS.

 Infrastructure As A Service (IAAS)

For instance, a company that want to be able to install certain softwares on the specific resources that the application will be running on, which gives the company a control how the application/ libraries behave. Such as python, Java, ruby. You want to be able to update it to a particular version. The KEY word is CONTROL over how to configure applications as they wish and  you decide what to install inside the machine. IAAS provides you that level of flexibility. Although, Google Cloud will be responsible in providing you the machine, managing the network layer that the compute sits on , and the actual compute itself ensuring its up and running at all time. As a platform professional you can use  GOOGLE COMPUTE ENGINE (GCE) to accomplish this as a virtual machine. 


Platform As A Service (PAAS):

In this case Google Cloud has services that they can provide to you to host your application and you do not have to manage the infrastructure at all. The infrastructure is fully managed by google cloud. When we talk about the infrastructure, google cloud focus on compute layer and everything that is below and some of the things above. And the only thing the client does is to handover its application to google cloud to manage it. As a cloud expert you can use GOOGLE APP ENGINE (GAE) to accomplish this.

Software As A Service (SAAS):

Google cloud is offering a software to you as a service, you do not have to do anything on the software when it comes to management, google cloud takes full responsibility. You only manage your data. And there are many services google cloud offers in that domain one of which is  GOOGLE CLOUD STORAGE( GCS)

Container As A Service (CAAS):
Is a subscription based cloud service model that allows you to manage containers, applications, and clusters using APIs, container-based virtualization and so on. This helps you to streamline and manage containers within software infrastructure either on-premises or in cloud. CAAS is a container package of software that includes all dependencies like code, runtime, configuration and libraries. example :Google Kubernetes Engine (GKE), Cloud Run. 

Function As A Service( FAAS):
This a a way to build and run applications without worrying about the underlying infrastructure. It function as Serverless computing which allows HTTP functions to be deployed for usage by other services or users. Developers write a code that triggers an incoming HTTP request. Some examples of FAAS include AWS Lambda, Cloud functions. 




In our next slide, we will buttress on cloud challenges!Happy Learning😊!!

Referencing:

    https://cloud.google.com/iap/docs/concepts-overview

  Mbandi AAK

Questia: https://www.blogger.com/blog/post/edit/5428112557550405099/1296614191750267780?hl=en

Wednesday, April 19, 2023

GCP IAM & RESOURCES HIERARCHY




Cloud Identity and Access Management (Cloud IAM) is a security framework that verify users and control their access rights, and denying access privileges. You are able to authenticate users and secure access across cloud, SaaS, on-premise and APIs. Here are some tips to help you use it better! 

  • Make sure that you only give people access to what they need.
  • Make sure that you take away access when people don't need it anymore.
  • Make sure that different people have different jobs so that no one person has too much power.
  • Make sure that you have a plan for how to manage all the different people who need access.
  • Make sure that you keep your password safe ( Credentials).
  • Make sure that you give people different levels of access depending on what they need.

The "who" can be a person, group, or application. 
The "what" refers to specific privileges or actions and the "resources" could be any Google Cloud service.


  GOOGLE CLOUD RESOURCE HIERARCHY

There is a resource hierarchy within the  resource manger. There are four different aspect of resource hierarchy. One of the first thing you define which will help you design the infrastructure will be;

  1. ROOT ORGANIZATION: This is mainly the domain of company and google cloud will need this as the principal piece that the organization need to represent your organization within GCP. Everything you literally be managing as an environment will be tied to this piece. For example, you search facebook.com, uber.com, shoeline.com, each of this search represent a domain to identify their structure within GCP. 

Another example: Lets say you have 500 employees within your organization each of them has an email that ends with the company domain, like uche@saskhealthregion.com. 

If you're making use of workspace formally called G- suite you can integrate all 500 users into cloud platform and centralize the control, even if you need to block a particular employee. 

1. FOLDERS (department): Can be used to segregate the different workloads that you are engaged in within the organization. For example, you have four team( A,B,C,D) and they handle independent project, generically, they will not need access because they are completely working on different project. Within a folder, you can have multiple objects to create resources. 

Folders are NOT used to deploy resource. The folder sits within the domain.


2. PROJECTS: In your cloud console you create a project, that project is called container where you house all the different resources that you can deploy within GCP. For example, if the resource sit within project that means project sits in the folder. 




3. RESOURCES: In blue shape has one parent and resources inherit policies from the parent. Examples of resources Cloud run, GCS, Cloud VPC, GCE. Within google cloud we have QUOTAS. Quota's are APIs that manage resources consumption within your ecosystem. Quota's are limits you set on your resources. You can request to increase quota through google cloud support. Managing limits can help with security and billing. 

4. LABELS: Are they object that manage and organize your workload around GCP probably for billing, governance, automation. It is based on key value pairs. 

QUESTION: One of the first question you may be likely asked, how will you access a resources in GCP meaning what interface to gain access to the platform to get familiar? When we talk about interface, we mean entry and exit communication.  There are four major interfaces to interact: 
2. mobile app (iOS and android), 
3. Cloud SDK (Software development kit)-  Allow you to programmatically interact your environment. This interface comprises of 3 major components. big query( warehouse), google cloud and google util( storage).
4. GCP client libraries( python, Node.js, Ruby ) mainly use by software developers. 

                 Cloud IAM 
Can only allow permitted set of policies either at the organization, Folders, Projects, or resources to function. 

Each policy contains set of roles and role members, with resources inheriting policies from their parent, lets think about this as resource policies are a union os parent and resource, in which we implement less restrictive parent policy will always override a more restrictive resource policy.

The organization administrator provides a user with the right access to all resources within the organization also the project creator role allows users to create project within the organization.





     WHAT IS A G SUITE

GCP is a suite of cloud computing services that runs on the same infrastructure that google uses internally for its end-user products. G-Suite is part of GCP WORKSPACE lunched in 2020. 

G Suite is a collection of cloud-based productivity and collaboration tools developed by Google. It includes Gmail, Google Drive, Google Docs, Calendar , Spread sheets and so on.

The three main editions of G -suite are monthly  Basic $6, Business $12 and Enterprises $25. There are several alternatives to G- suites  that you can consider like Fast mail, Office365, Zoho Workplace, Godaddy Email and office. etc


       THE ROLE OF RESOURCE MANAGER


   TYPES OF IAM ROLES

There are three types of IAM roles: Primitive/basic , Predefined, Custom.

Primitive/basic roles are the original roles that were available in the cloud console and it's broad. IAM basic roles offer fixed, coarse-grained levels of access.






GCP services offers their own sets of predefined roles, and they defined where those roles can be applied. This provides members with granular access to specific GCP resources and prevents unwanted access to other resources. The permissions itself are classes and methods in the APIs.      


In our next slide, we will buttress on service models! Happy Learning😊!!

Referencing : https://cloud.google.com/iap/docs/concepts-overview

  https://domains.google/?pli=1

                      Polarsparc

Questia: https://www.blogger.com/blog/post/edit/5428112557550405099/7327624698061978921?hl=en

Tuesday, April 11, 2023

DOCKER RUN COMMAND

 



Docker run command is used to run a command in a new container. it creates a new space where you can put things and play with them without affecting your room. Each time operators executes docker run, the container processes that runs is isolated in that, its has its own file system, its own networking which is separate from the host.

Docker run command you must specify an IMAGE to derive a container. Within the default image, we can relate to these features:
  • network settings
  • container identification
  • runtime on the CPU and memory
  • detached running
There are few docker run commands that we would like to learn. In this case we will run a docker redis and jenkins command to run a container running a Redis/ Jenkins service. 

STEP 1:

Lunch Ec2- t2micro- ssh, port 80
SSH

sudo yum update
sudo su -
yum install docker -y
systemctl start docker
systemctl enable docker
systemctl status docker

STEP 2: 
docker run redis. In this case, the latest Redis version=7.0.10

docker run redis
Unable to find image 'redis:latest' locally
latest: Pulling from library/redis
f1f26f570256: Pull complete
8a1809b0503d: Pull complete
d792b14d05f9: Pull complete
ad29eaf93bf6: Pull complete
7cda84ccdb33: Pull complete
95f837a5984d: Pull complete
Digest: sha256:7b83a0167532d4320a87246a815a134e19e31504d85e8e55f0bb5bb9edf70448
Status: Downloaded newer image for redis:latest
1:C 06 Apr 2023 19:48:06.966 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 06 Apr 2023 19:48:06.966 # Redis version=7.0.10, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 06 Apr 2023 19:48:06.966 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 06 Apr 2023 19:48:06.967 * monotonic clock: POSIX clock_gettime
1:M 06 Apr 2023 19:48:06.968 * Running mode=standalone, port=6379.
1:M 06 Apr 2023 19:48:06.969 # Server initialized
1:M 06 Apr 2023 19:48:06.969 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 06 Apr 2023 19:48:06.969 # WARNING Your system is configured to use the 'xen' clocksource which might lead to degraded performance. Check the result of the [slow-clocksource] system check: run 'redis-server --check-system' to check if the system's clocksource isn't degrading performance.
1:M 06 Apr 2023 19:48:06.970 * Ready to accept connections



What if we need to run an older version of redis, you specify with (:) 


## The (:4.0) is the tag.
docker run redis:4.0
Also if do not specify a tag docker will automatically assume the default it to be "latest". Latest is the tag associates to the software latest version. As a user, to find the information about this version, you visit docker hub.

STEP 3:
For example: Lets deploy an image from docker hub for Jenkins. Jenkins is a build application, it is a continuous and delivery server. Instead of running so many dependencies on your host machine. All you do, is run Jenkins as a container . Keep in mind that Jenkins is a web server. 

[root@ip-172-**-00-00 ec2-user]# docker run jenkins/jenkins
Using default tag: latest
Error response from daemon: manifest for jenkins:latest not found: manifest unknown: manifest unknown
[root@ip-172-*1-00-00 ec2-user]# docker pull jenkins:2.60.3
2.60.3: Pulling from library/jenkins
55cbf04beb70: Pull complete
1607093a898c: Pull complete
9a8ea045c926: Pull complete
d4eee24d4dac: Pull complete
c58988e753d7: Pull complete
794a04897db9: Pull complete
70fcfa476f73: Pull complete
0539c80a02be: Pull complete
54fefc6dcf80: Pull complete
911bc90e47a8: Pull complete
*************************************************************
*************************************************************
*************************************************************

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

# This output generated a password as an admin user to unlock JENKINS
1ea25d6b860e4bc186fc2ece7a7aad02

This may also be found at: /var/jenkins_home/secrets/initialAdminPassword

*************************************************************
*************************************************************
*************************************************************

2023-04-08 17:36:44.465+0000 [id=29] INFO jenkins.InitReactorRunner$1#onAttained: Completed initialization
2023-04-08 17:36:44.504+0000 [id=22] INFO hudson.lifecycle.Lifecycle#onReady: Jenkins is fully up and running
2023-04-08 17:36:44.597+0000 [id=42] INFO h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tasks.Maven.MavenInstaller
2023-04-08 17:36:44.599+0000 [id=42] INFO hudson.util.Retrier#start: Performed the action check updates server successfully at the attempt #1

Open another shell to access the docker host. You can see Jenkins is running on port "8080". We are currently within the internal IP of the docker host. 

Package docker-20.10.17-1.amzn2023.0.6.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[root@ip-172-31-81-127 ec2-user]# systemctl start docker
[root@ip-172-31-81-127 ec2-user]# systemctl enable docker
[root@ip-172-31-81-127 ec2-user]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: d>
Active: active (running) since Sat 2023-04-08 17:34:11 UTC; 20min ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Main PID: 26694 (dockerd)
Tasks: 10 (limit: 1112)
Memory: 76.7M
CPU: 14.200s
CGroup: /system.slice/docker.service
└─26694 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/con>

Apr 08 17:34:10 ip-172-31-81-127.ec2.internal dockerd[26694]: time="2023-04-08T>
Apr 08 17:34:10 ip-172-31-81-127.ec2.internal dockerd[26694]: time="2023-04-08T>
Apr 08 17:34:11 ip-172-31-81-127.ec2.internal dockerd[26694]: time="2023-04-08T>
Apr 08 17:34:11 ip-172-31-81-127.ec2.internal dockerd[26694]: time="2023-04-08T>
Apr 08 17:34:11 ip-172-31-81-127.ec2.internal dockerd[26694]: time="2023-04-08T>
Apr 08 17:34:11 ip-172-31-81-127.ec2.internal dockerd[26694]: time="2023-04-08T>
Apr 08 17:34:11 ip-172-31-81-127.ec2.internal systemd[1]: Started docker.servic>
Apr 08 17:34:11 ip-172-31-81-127.ec2.internal dockerd[26694]: time="2023-04-08T>
Apr 08 17:35:00 ip-172-31-81-127.ec2.internal dockerd[26694]: time="2023-04-08T>
Apr 08 17:40:43 ip-172-31-81-127.ec2.internal dockerd[26694]: time="2023-04-08T>
lines 1-22
^C
[root@ip-172-31-81-127 ec2-user]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
45199e9a57b6 jenkins/jenkins "/usr/bin/tini -- /u…" 11 minutes ago Up 11 minutes 8080/tcp, 50000/tcp practical_feistel


DOCKER INSPECT
To find out the IP of the container /details of a specific container run "docker inspect container id" It returns the details of the container in a json format like:
  • Configuration 
  • network settings ( Within Bridge network)
  • mounts
  • state
  • container id. etc.
## To find out your internal IP, docker inspect and container ID
docker inspect 45199

"NetworkSettings": {
"Bridge": "",
"SandboxID": "00000000000002270000000000",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"50000/tcp": null,
"8080/tcp": null
},
"SandboxKey": "/var/run/docker/netns/47929a2f8743",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "000000000002cae00000000000",
"Gateway": "00.100.0.00",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "00:00:hf:00:00:00",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "**********000000000000",
"EndpointID": "0000000000000000000527f8a000000000000",
"Gateway": "00.100.0.00",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "00000000",
"DriverOpts": null
}
}
}
}
]

The IP "172.17.0.2:8080" to access the browser




              PORT MAPPING ON CONTAINER :
In order to achieve port mapping, first, you have to stop the docker container. This is an instance where you run a web application in a docker container on your docker host. And we ensure the server is running. The question is, how does a user access the application?

For example: Lets' say our application is running on port "3200". It means you can access the application on port "3200". You can use the IP of the docker container which is a default "172.17.0.2" (internal ip) and can only be assessable within the docker host. In order to access the browser within the docker host https://"172.17.0.2":8080. Since, this is an internal IP address users outside world cannot access the IP. 

However, we can use the IP of the docker host "192.168.1.5"and for this to work, we will have to map the port inside the docker container to A FREE PORT ON THE DOCKER HOST. 

For example: If you want the users(world) to access your application through "port 80" on my docker host, you can map port 80 of the local host to port "3200" on the docker container using the docker "-p"(publish) parameter within the the run command below. Now, the user can have access to the application by going to the URL HTTP
"192.168.1.5:80. Which means all traffic on port 80 docker host will gets routed to 3200 inside the docker container. You have options to map multiple container to hosts. 


HOW DATA IS CAPTURED IN REAL TIME 
The aspect of data, we will make use of mysql database. 


Docker run mysql

Each time a database are created the files are stored in /var/lib/mysql
inside the docker container. By default the docker container has its own file system and any changes should be done within the container. 
In order to persist data, you will map a directory OUTSIDE the container on the docker host to a directory INSIDE the container. In this case we use the "-V" parameter and create an external directory "/uche/datadir"and map it to  /var/lib/mysql. When docker container runs  it will implicitly mount the external directory to the FOLDER inside the docker container. 
 All your data will be stored in the external volume, you do not have to worry about loosing it. 




Docker run STDIN: The stdin is used to attach standard input to the container and this is done by attaching the "-i". The "-i" parameter is for interactive mode. Another command you can attach to the parameter is "t".The "-it" helps you to interact with the sudo terminal.
      
 DOCKER LOGS
You can view log of your container run "docker log container id"



Next slide we will talk about the networking . Happy Learning !!! 😊 
Kindly like and comment. 










Sunday, April 9, 2023

DOCKER ARCHITECTURE




Docker Architecture explains how docker uses a client-server architecture at it's core. Docker engine is used to run the operating system which earlier used to be a virtual machine as docker containers. Today, all the applications now run as Docker containers. The advantages of Docker is that you do not have to purchase extra hardware for your OS. Docker architecture comprises of three main components.

  • Docker client
  • Docker daemon
  • Docker registry.
DOCKER DAEMON : This is responsible for managing docker objects like images, containers, volumes and networks.

DOCKER CLIENT : This helps Docker users to interact with Docker when you apply commands like "docker run", the client sends these commands to dockerd, which carries them out. It also uses REST APIs to communicate with the docker daemon server. 

In a more simpler way, Docker client is like a teacher who tells the Docker daemon what to do. When you use commands like docker run, the client carries these command out. 

DOCKER REGISTRY: This stores docker images.

WHAT INSTANCES CAN I USE DOCKER?

  • Code Pipeline Management
  • Debugging Capabilities
  • Simplifying Configuration
  • Server Configuration
  • Multi-workflow

 DIFFERENCE BETWEEN DOCKER AND VIRTUAL MACHINE

Docker images uses megabytes (smaller)

Docker is faster, and it uses your local machine and O/S as well.

Docker uses the kernel of the Host. 

VM uses larger gigabyte.

VM run any O/S to another Host.


The image shows the new generation architecture virtualization in the world of Docker.



  • The server is the physical server that can used on multiple VM.
  • The Host Operating System (OS) serves as the base of an Ubuntu, Linux, Windows.
  • Docker engine is used to run the operating system as Docker containers.
  • All the Apps run as Docker containers. 
                 
OPERATING SYSTEM 
The operating system has two layers.

Kernel : This communicates with CPU (hardware)
Application: This runs on the kernel. 



I hope this explains how to explore docker images. Have a excellent learning experience😊!

Referencing : Docker Docs: How to build, share, and run applications

Uche Questia : https://www.blogger.com/blog/post/edit/5428112557550405099/1602697879220214062?hl=en



















Thursday, April 6, 2023

DOCKER COMMANDS HANDS-ON

 



 Each lab scenario gives you the opportunity to familiarize with the set up.  You will be expected to perform tasks like run a container, build, delete and stop. 

STEP 1: 
Docker  Version : To check the version of Docker Server Engine running on the host.

The output will show you both the client and server version of Docker engine installed on your system. 

$ docker version
Client: Docker Engine - Community
Version: 19.03.15
API version: 1.40
Go version: go1.13.15
Git commit: 99e3ed8919
Built: Sat Jan 30 03:17:11 2021
OS/Arch: linux/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 19.03.15
API version: 1.40 (minimum version 1.12)
Go version: go1.13.15
Git commit: 99e3ed8919
Built: Sat Jan 30 03:15:40 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.3
GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b
runc:
Version: 1.0.0-rc92
GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
docker-init:
Version: 0.18.0
GitCommit: fec3683
$




STEP 2:
How many images are available ? You run the command docker images

$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mysql latest 4f06b49211c0 5 weeks ago 530MB
nginx alpine 2bc7edbc3cf2 7 weeks ago 40.7MB
postgres latest 680aba37fd0f 7 weeks ago 379MB
alpine latest b2aa39c304c2 7 weeks ago 7.05MB
redis latest 2f66aad5324a 7 weeks ago 117MB
nginx latest 3f8a00f137a0 7 weeks ago 142MB
ubuntu latest 58db3edaf2be 2 months ago 77.8MB


STEP 3:
You can run a container using the redis image. 


$ docker run -t redis
1:C 05 Apr 2023 16:10:51.377 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 05 Apr 2023 16:10:51.377 # Redis version=7.0.8, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 05 Apr 2023 16:10:51.377 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 05 Apr 2023 16:10:51.378 * monotonic clock: POSIX clock_gettime
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 7.0.8 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 1
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | https://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'


STEP 4:
docker run redis 

$ docker run redis
1:C 05 Apr 2023 16:55:43.279 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 05 Apr 2023 16:55:43.279 # Redis version=7.0.8, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 05 Apr 2023 16:55:43.279 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /pa

STEP 5:
Can you stop the running container you just created. 


$ docker stop 8413d7fdbfdb
8413d7fdbfdb
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8413d7fdbfdb redis "docker-entrypoint.s…" 5 minutes ago Exited (0) 10 seconds ago jolly_nightingale


STEP 6:
To check the running container. 

$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
$


STEP 7:
How many containers are present on the host including both running and not running ones.

$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8413d7fdbfdb redis "docker-entrypoint.s…" 5 minutes ago Exited (0) 10 seconds ago jolly_nightingale
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8413d7fdbfdb redis "docker-entrypoint.s…" 8 minutes ago Exited (0) 3 minutes ago jolly_nightingale
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
37bf0d26e4c1 alpine "/bin/sh" About a minute ago Exited (0) About a minute ago charming_cori
cd25b2b81889 alpine "sleep 1000" About a minute ago Up About a minute pedantic_kapitsa
f30f483b1c0a nginx:alpine "/docker-entrypoint.…" About a minute ago Up About a minute 80/tcp nginx-2
d74280453797 nginx:alpine "/docker-entrypoint.…" About a minute ago Up About a minute 80/tcp nginx-1
c841b3e99c4a ubuntu "sleep 1000" About a minute ago Up About a minute awesome_northcut
8413d7fdbfdb redis "docker-entrypoint.s…" 11 minutes ago Exited (0) 5 minutes ago jolly_nightingale
$



STEP 8:
To stop the container you just created.

$ docker stop 2f791
2f791
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2f791c2115ff redis "docker-entrypoint.s…" 7 minutes ago Exited (0) 6 minutes ago competent_cartwright
$

STEP 9:
To stop containers run the command "docker stop (container id) (container name) and then to delete them run docker rm (container id)

$ docker stop 86eff91657af crazy_meitner
86eff91657af
crazy_meitner
$ docker rm 86eff91657af
86eff91657af
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ef7675b669eb nginx:alpine "/docker-entrypoint.…" 10 minutes ago Up 10 minutes 80/tcp nginx-2
998bd5125c4d nginx:alpine "/docker-entrypoint.…" 10 minutes ago Up 10 minutes 80/tcp nginx-1
5792f6aaa0b0 ubuntu "sleep 1000" 11 minutes ago Up 10 minutes awesome_northcut
2a0ee489807d redis "docker-entrypoint.s…" 12 minutes ago Exited (0) 11 minutes ago ecstatic_darwin
2f791c2115ff redis "docker-entrypoint.s…" 24 minutes ago Exited (0) 23 minutes ago competent_cartwright
$ docker stop ef7675b669eb nginx-2
ef7675b669eb
nginx-2
$ docker rm ef7675b669eb
ef7675b669eb
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
998bd5125c4d nginx:alpine "/docker-entrypoint.…" 12 minutes ago Up 12 minutes 80/tcp nginx-1
5792f6aaa0b0 ubuntu "sleep 1000" 12 minutes ago Up 12 minutes awesome_northcut
2a0ee489807d redis "docker-entrypoint.s…" 14 minutes ago Exited (0) 13 minutes ago ecstatic_darwin
2f791c2115ff redis "docker-entrypoint.s…" 26 minutes ago Exited (0) 25 minutes ago competent_cartwright
$


STEP 10:
To delete an ubutu image. The command is "docker rmi ubuntu"

$ docker rmi ubuntu
Untagged: ubuntu:latest
Untagged: ubuntu@sha256:9a0bdde4188b896a372804be2384015e90e3f84906b750c1a53539b585fbbe7f


STEP 11:
To pull an image. 

$ docker pull nginx:1.14-alpine
1.14-alpine: Pulling from library/nginx
bdf0201b3a05: Pull complete
3d0a573c81ed: Pull complete
8129faeb2eb6: Pull complete
3dc99f571daf: Pull complete
Digest: sha256:485b610fefec7ff6c463ced9623314a04ed67e3945b9c08d7e53a47f6d108dc7
Status: Downloaded newer image for nginx:1.14-alpine
docker.io/library/nginx:1.14-alpine
$


STEP 12:
You can run a container with the nginx:1.14-alpine image and name it webapp .

$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
$ docker run -d --name webapp nginx:1.14-alpine
3b1729e87ea63258d4a99d95ee7481f35fccdd83a95f8fa7ec3dc8d131879d80
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3b1729e87ea6 nginx:1.14-alpine "nginx -g 'daemon of…" 9 seconds ago Up 7 seconds 80/tcp webapp
$
Kode kloud
Next slide we will discuss on docker run . Happy Learning !!! 😊

GRC

  How confident are you in your security program (Tools, systems, controls etc)? In the context of information security , the terms valida...