Menu ×

Interview Preparation Guide

Most Asked DevOps Interview Questions

Here we have compiled the most probable DevOps interview questions asked in the industry. You will learn about software version control, Git repository, reverting a commit in Git, Vagrant, continuous testing elements, and the importance of continuous integration, testing, and deployment. These questions are curated after discussing with many interviewers and DevOps Training experts.

DevOps Tools

Git
Maven
Jenkins
Docker
Ansible
Terraform
Kubernetes
Tomcat
linux
Interview Questions
Showing 221 - 230 of 325 results
221. What is the lifecycle of a Docker Container?

A complete lifecycle of Docker containers:
*. Create a container
*. Run the container
*. Start the container
*. Stop the container
*. Pause the container
*. Unpause the container
*. Restart the container
*. Kill the container
*. Destroy the container

222. What is Docker Machine?

You can use Docker Machine to install Docker Engine, and Docker Swarm on one or more virtual systems. These hosts can be managed by using the docker-machine commands.

223. How to check versions of Docker Client and Docker Server?

This is the command used to know about Docker Client and Server versions:
$ sudo docker --version

224. How to get the number of containers running, paused and stopped?

You can use the following command to get detailed information about the docker installed on your system.
$ docker info (or)
$ docker ps -a (or)
$ docker container ls -a
You can get the number of containers running, paused, stopped, the number of images and a lot more.

225. How to build a Dockerfile?

Once you’ve written a Dockerfile, you need to build it to create an image with those specifications. Use the following command to build a Dockerfile:
$ "docker build -t < username/imageName > ."
Here at the end of the above command one space and period(.) includes a command to locate the path of Dockerfile. And instead of period(.) use the entire path if it is not stored in the same directory.

226. How to login into docker repository or registry?

You can use the following command to login into hub.docker.com:
$ docker login
You’ll be prompted for your username and password, insert those, you’re logged in.

227. How do you modify a base image or personalize it?

Pull an image from docker hub to your local system with one simple command:
$ docker pull < image_name >
Then write a docker file as per your requirement, Then build the image using that Dockerfile
$ " docker build -t < username/image-name:tag > . ". Now you have your own customised image.

228. How do you list all the running containers?

This is the command to lists down all the running containers:
$ docker ps (or)
$ docker container ls

229. How do you access a container among 50 running containers? And how do you execute a command in it?

This is the command to get access to a running container and to run a commands in it:
$ docker exec -it < container-id > bash-name
For example $ docker exec -it my_container /bin/bash
The exec command lets you execute commands inside a container.
Or
$ docker attach < container-id >
But, the first method is preferable and recommended.

230. How to Start, Stop and Kill a container?

To start a docker container this is the command :
$ docker start < container_id >and for stopping a running container:
$ docker stop < container_id >
And to kill a container:
$ docker kill < container_id >

Icon Stack with Contact Form
Contact us