DevLabs Alliance - WhatsApp
DevLabs Alliance Logo

Home / Blogs /What is a Docker co...

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

Admin

2023-09-07

DevLabs Alliance Blogs

0 mins read

What is a Docker container

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


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 the 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>


Know Our Author

DevLabs Alliance Author Bio

Admin


DevLabs Alliance TwitterDevLabs Alliance LinkedInDevLabs Alliance Instagram

Author Bio

DevLabs Alliance conducts career transformation workshops & training in Artificial Intelligence, Machine Learning, Deep Learning, Agile, DevOps, Big Data, Blockchain, Software Test Automation, Robotics Process Automation, and other cutting-edge technologies.

INQUIRY

Want To Know More


Email is valid



Phone


By tapping continuing, you agree to our Privacy Policy and Terms & Conditions

“ The hands-on projects helped our team put theory into practice. Thanks to this training, we've achieved seamless collaboration, faster releases, and a more resilient infrastructure. ”
DevLabs Alliance Blogs Page Review
Vijay Saxena

SkillAhead Solutions

DevLabs Alliance Footer section
DevLabs Alliance LinkedIn ProfileDevLabs Alliance Twitter ProfileDevLabs Alliance Facebook ProfileDevLabs Alliance Facebook Profile
DevLabs Alliance Logo

Gurgaon

USA

1603, Capitol Avenue, Suite 413A, 2659, Cheyenne, WY 82001, USA

DevLabs Alliance ISO 9001

DevLabs Alliance Footer SectionDevLabs Alliance Footer SectionDevLabs Alliance Footer SectionDevLabs Alliance Footer SectionDevLabs Alliance Footer SectionDevLabs Alliance Footer SectionDevLabs Alliance Footer SectionDevLabs Alliance Footer Section

`Copyright © DevLabs Alliance. All rights Reserved`

|

Refund & Reschedule Policy

Privacy Policy

Terms of Use