Terraform Assignment – 2 by Johnson

Ansible playbook demo.yaml -name= install nginxhosts= webservertasks=-name: install nginx in serveryum:name: httpdstate: latest Terraform script to insstall ansible and python provider “aws” {access_key = “*******************”secret_key = “*********************”region = “eu-west-3”} resource “aws_instance” “web” {ami = “ami-12345”instance_type = “t3.micro”count = 1tags = {Name = “Demo”}} provisioner “file” {source = “etc/demo.yaml” destination = “etc/demo.yaml”} provisioner “remote-exec” {inline = [“sudo apt update”, “sudo apt install python3 -y”, “sudo apt install ansible -y”] connection {host = self.ipv4_addresstype = “ssh”user = “root”private_key = file(var.pvt_key)} } provisioner

Read more

Terraform Assignment – 1by Johnson

provider “aws” {access_key = “************”secret_key = “************”region = “eu-west-3”} provider “github” {token = “*************”} variable “instance_count” {type = numberdescription = “This is for demo of number variable”default = 3} variable “reponame” {type = stringdescription = “This is for demo of string variable”default = “day3-broad”} variable “users” {type = “list”default = [“demo1”, “demo2”, “demo3”]description = “This is for demo of list variable”} variable “amis” {type = “map”default = {“us-east-1” = “ami-b374d5a5”“us-west-2” = “ami-4b32be2b”}} resource “github_repository” “repo” {name = var.reponamedescription = “Demo

Read more

7. List of 20 docker commands and its use cases with example? by Johnson

docker ps — To check running containers docker images — To check pulled images docker pull — To pull images from docker hub registry docker push — To push custom images to docker hub registry docker run — To start and run a container docker exec — To enter inside the container with shell docker start — To start a container docker stop — To stop a container docker restart — To restart a container docker build — To build

Read more

5. List of dockerfile instructions and its Brief Summary? by Johnson

FROM : To create a base image such as an operating system RUN: A RUN instruction is used to run specified commands. We can use multiple RUN instructions to run different commands. CMD: If we need to run a default command that executed for all the containers of the image. If we want to run command during docker run command it overrides the default one. ENTRYPOINT: If we try to specify default arguments in the docker run command, it will

Read more

1.Components of Docker and its Brief Summary by Johnson

Components of docker are Docker engine Docker registry Docker image Docker container Docker engine Docker engine is a command-line and it is interact with docker daemon. When we run docker commands the instructions sends to the daemon and perform operation by other components. Docker registry Docker registry is a hosted service where the docker images are stored. We can create an repository and store our own images also. It has both private and public repositories. Docker image. Docker image is

Read more