Blog

devops interview questions

What is a Docker container? How do you create, start and stop containers?

Share:

Docker is a containerization technology that packages your application and all its dependencies together in the form of Containers to ensure that your application works seamlessly in any environment.

A container consists of an entire runtime environment: an application, plus all its dependencies, libraries and other binaries, and configuration files needed to run it, bundled into one package.

Containerizing the application platform and its dependencies eliminates any infrastructure differences and maintains consistency across environments.

They share the kernel with other containers, running as isolated processes in user space, on the host operating system.

Docker containers can be created by either creating a Docker image and then running it or you can use Docker images that are present on the Docker hub.

We can use Docker image to create Docker container by using the below command:

docker run -t -i <image name> <command name>

This command will create and start container.

Docker container can be run in two modes:

Attached:  Where it will be run in the foreground of the system you are running, provides a terminal inside to container when -t option is used with it, where every log will be redirected to stdout screen.

Detached: This mode is usually run in production, where the container is detached as a background process and every output inside the container will be redirected to log files which can be viewed by docker logs command.

To check the list of all running containers with status on a host:

docker ps -a

To stop the Docker container:

docker stop <container ID>

To restart the Docker container you can use:

docker restart <container ID>

More DevOps Interview Questions by Devlabs Alliance

1. Popular DevOps Interview Questions.

2. Difference between Git and SVN.

3. Which among Puppet, Chef, SaltStack and Ansible is the best Configuration Management (CM) tool and Why?

4. What is CI? What is its purpose?

5. What is Nagios?

6. How do all the automation tools work together in a CICD flow?

Related Articles
Categories
Latest Articles

Popular Courses

Google Reviews
  • review rating 5  Excellent Training program. Training courses and trainers are very good. Trainer will explain you as many time you ask the question. Best thing is hands on based training. You learn by doing. Looking for more courses from here.

    thumb Vijay Kumar
    6/30/2019
  • review rating 4  It was good session, I left my training room with basic knowledge on all the tools. Tutors have great knowledge and experience on the tools. But three days is not enough time.

    thumb sairam shyamala
    6/30/2019
  • review rating 4  Training provided by the trainers in DevLabs Alliance is completely awesome. Trainers are highly qualified in their areas with practical experience. Since it is 3 days training we have completely got the opportunity to have hands on.

    thumb Salaja K
    6/30/2019
  • review rating 4  Both trainers (Ravi and Naresh) were excellent in their approach. Session was less of a theory and more of a practical. And even the theory part was quite interesting. A bit issue with the volume of information which I had received in just a span of 2-3 days - it seemed a bit over-loaded. But overall, it has given me a great platform to take it forward from here!

    thumb Varenya Varshney
    6/02/2019
  • review rating 5  Training provided by the trainers here is completely awesome. Trainer is highly qualified in their areas with practical experience. Also amenities provided during training by institute is great

    thumb Abhishek Tripathi
    6/02/2019
$('.enrollbtn').on('click', function (){ $( "#announcement" ).tabs( "option", "active", 0 ); $(' a[href="#announcement"]').trigger('click'); });