Terraform assignment-1 by Bharath Srinivas

provider “aws” {region = “ap-south-1”access_key = “”secret_key = “”} provider “github” {token = “”organization = “”} variable “instance_count” {type = numberdescription = “This is for demo of number variable”default = 2 }variable “users” {type = “list”default = [“bharath”, “sharath”, “nikhil”]description = “This is for demo of list variable”} variable “amis” {type = “map”default = {“us-east-1” = “ami-““us-west-2” = “ami-“}} variable “reponame” {type = stringdescription = “This is for demo of string variable”default = “terraform”} resource “aws_iam_user” “iamuser” {name = “${var.users[0]}”}

Read more

Terraform-Assignment2 by Bharath Srinivas

provider “aws” {access_key = “”secret_key = “”region = “eu-east-2”} resource “aws_instance” “web” {ami = “ami-xbbsj”instance_type = “t2.micro”count = 1tags = {Name = “Demo”}} provisioner “file” {source = “conf/install-apache.yml”destination = “/etc/install-apache.yml”} provisioner “remote-exec” {inline = [“sudo apt update”, “sudo apt install python3 -y”, “sudo apt install ansible -y”] } provisioner “local-exec” {command = “ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -u root -i ‘${self.ipv4_address},’ –private-key ${var.pvt_key} -e ‘pub_key=${var.pub_key}’ install-apache.yml”} } install-apache.yml -name=install_httpdhosts=webservertasks=-name:install httpd in serveryum:name: httpdstate: latest

Read more

What is the difference between CMD vs Entrypoint?

CMD You can set default commands with parameters using the CMD instruction. If you run a Docker container without specifying any additional CLI commands, the CMD instruction will be executed. You can include an executable as the default command. However, if you choose to omit it, you will have to specify an ENTRYPOINT instruction along with the CMD instruction. If you have specified an argument along with the Docker run command, the default one specified using the CMD instruction will

Read more

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

List of docker file instructions and its Brief Summary?

FROM A FROM command allows you to create a base image such as an operating system, a programming language, etc. All the instructions executed after this command take place on this base image. It contains an image name and an optional tag name. If you already have the base image pulled previously in your local machine, it doesn’t pull a new one. There are several pre published docker base images available in the docker registry. You can also push your

Read more

What is the difference between docker stop and kill?

docker stop The docker stop command stops the container gracefully and provides a safe way out. If a docker stop command fails to terminate a process within the specified timeout, the Docker issues a kill command implicitly and immediately. In Docker, there are two ways we can use the docker stop command to stop a process. We can use container Id or container name to stop a container. docker kill The docker kill command terminates the entry point process abruptly. The docker kill command causes an unsafe exit. In some cases, the docker container

Read more

Components of Docker and its Brief Summary

The Docker components are divided into two categories; basic and advanced. The basic components include Docker client, Docker image, Docker Daemon, Docker Networking, Docker registry, and Docker container, whereas Docker Compose and Docker swarm are the advanced components of Docker.  Basic Docker Components: Lets dive into basic docker components: Docker Client: The first component of Docker is the client, which allows the users to communicate with Docker. Being a client-server architecture, Docker can connect to the host remotely and locally. As

Read more

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

docker pull: pull the image from the docker hubdocker ps: list the running containersdocker ps -a: list the running and stopped containersdocker start start the containerdocker stop: stop the one or more running containersdocker restart: restart the containerdocker rm: remove the containerdocker exec: runs a new command in a running containerdocker image: show all imagedocker info: show the information about docker installationdocker kill: kill one or more running containersdocker login: login into docker register

Read more

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

FROM: specify the valid docker image name, LABEL: metadata infomation to the image, ADD: copy files, directories and remote URL files to the destination, RUN: executes any command, WORKDIR: set the working directory, ENV: set environment variables with key and value, COPY: copy files, directories and remote URL files to the destination, MAINTAINER: author who create the docker image

Read more

1. Components of Docker and its Brief Summary? by Ramalakshmi

Docker follows Client-Server architecture. Docker having three main components Docker Client, Docker Host, and Docker Registry.Docker Client: Docker client uses REST APIs to communicate with the Docker server when the client send commands to the server, server receives commands in the form of REST APIs request.Docker Host: Docker Host is used to provide an environment to execute and run applications. It contains the docker daemon, images, containers, networks, and storage.Docker Registry: Docker Registry manages and stores the docker images

Read more

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

docker info: displays information about docker installation docker ps : to check the running containers docker ps -a : to check all the containers which are running and exited docker images: to check the list of images docker pull: to pull the image from registry docker push: to push the created image to registry docker stop: to stop the container docker start: to start the stopped container docker kill: to kill the running container unsafe docker rmi: to remove the

Read more

5. List of Docker file instructions and its Brief Summary? by Bharath Srinivas

FROM : To get the base image MAINTAINER: author of the generated image ADD: It is similar to COPY but it supports get remote URLs and also unzips tar balls RUN: Run is used to run specific commands. CMD: This is similar to ENTRYPOINT it allows the override the command ENTRYPOINT: after starting the container it is the initial process that runs. Entry point doesn’t allow override the command WORKDIR: Used to create working directory inside the container. COPY: copy

Read more
1 23 24 25 26 27 185