This content originally appeared on DEV Community and was authored by osama
Docker: Brief Introduction.
Learn about Docker containers, images, installations and everything you need to know about Docker.
About Docker :
Docker is an open source containerization platform. It enables developers to package applications into containers — standardized executable components combining application source code with the operating system (OS) libraries and dependencies required to run that code in any environment. IBM
in simple words :
Docker is an application build and deployment tool. It is based on the idea of that you can package your code with dependencies into a deployable unit called a container. Containers have been around for quite some time. nebula works
in nutshell :
You experience this situation, The code works perfectly in my machine, but it doesn’t in others machines.
the situation of when you shipped the code to production and it didn't work, but it works well in your machine.
Here is where Docker introduce itself as the saver for you and your code,
it simply creates a container for your project files, directories, tools and everything your code needs, and that container can be used and run perfectly in any system or machine (your machine or the cloud host).
Why use Docker:
Solve the headache of “**It works on my machine…!!”
**with the code being in a container, it can be run everywherea good solution for microservices architecture projects
turn every service of your product into a simple docker container
Containers aren’t required to implement microservices, but they are perfectly suited to the microservices approach and agile development processes generally.-
Docker enables faster software delivery cycles
make the process of CI/CD seamlessly and easy.Enterprise software must respond quickly to changing conditions. That means both easy scaling to meet demand and easy updating to add new features as the business requires.
Docker containers make it easy to put new versions of software, with new business features, into production quickly — and to quickly roll back to a previous version if you need to. They also make it easier to implement strategies like blue/green deployments.
Main Concepts:
let's dive a little bit into docker and get to know how it works under the hood and what its components.
Containers:
A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.
also, A container is a runnable instance of an image. You can create, start, stop, move, or delete a container using the Docker API or CLI.
Image:
A Docker image is a file used to execute code in a Docker container. Docker images act as a set of instructions to build a Docker container, like a template. Docker images also act as the starting point when using Docker. An image is comparable to a snapshot in virtual machine (VM) environments.
DockerFile:
A DockerFile is a text file that contains instructions on how to build a docker image. A Dockerfile specifies the operating system that will underlie the container, along with the languages, environmental variables, file locations, network ports, and other components it needs — and what the container will do once we run it.
The process of containerization your code:
the process of turning your code into a docker container that can run everywhere is called containerization
Containerization is OS-based virtualization that creates multiple virtual units in the userspace, known as Containers. Containers share the same host kernel but are isolated from each other through private namespaces and resource control mechanisms at the OS level. geeksforgeeks
Containerization is an approach to software development in which an application or service, its dependencies, and its configuration (abstracted as deployment manifest files) are packaged together as a container image. The containerized application can be tested as a unit and deployed as a container image instance to the host operating system (OS). microsoft docs
hard to understand? in simple words containerization is just an approach to collecting all files and tools and configurations that your project needs in one place, a container, and then you can run, deploy, test and delete your container the way you want from any machine that supports docker
you'll ship your code and everything it needs in a container, you execute the code inside this container using a docker image, and the Doker file will contain a series of instructions to specify how to build a docker image.
This is not exactly how things work but I hope you get the main idea!
Installation:
to install docker on your machine, read this documentation in docker.com
Get Docker
on Linux:
Install Docker Desktop on Linux
on macOS:
Install Docker Desktop on Mac
on Windows:
Install Docker Desktop on Windows
Resources:
What is Docker? | AWS
Docker Tutorial: Get Going From Scratch
Why Should You Use Docker - 7 Major Reasons! - GeeksforGeeks
Docker vs Kubernetes :
Kubernetes vs. Docker: What's the difference?
Kubernetes vs Docker: What's the difference?
Kubernetes vs Docker | Microsoft Azure
Kubernetes Vs Docker | Sumo Logic
Links :
Home - Docker
What is Docker?
Docker Hub Container Image Library | App Containerization
Thanks for reading, and feel free to ask any question about javascript or this series, I appreciate any feedback to improve My content.
find me on Twitter, Github and my portfolio.
This content originally appeared on DEV Community and was authored by osama
osama | Sciencx (2022-07-23T19:38:58+00:00) Docker: Brief Introduction.. Retrieved from https://www.scien.cx/2022/07/23/docker-brief-introduction/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.