
Image: Its Readable or Read only Template, that contains everything needed to run an application, includes the code, runtime, libraries, environment variables and configuration files.
Purpose: It serves as a blueprint for creating containers.
state: Immutable - Cannot be changed once built.
Container: " A running instance of of an image." its add an writable layer on top of the image allowing changes during runtime or its an isolated environment of running instance of image, where actual application will be running.
Purpose: It is an actual environment, where our application runs.
state: Mutable- We can modify files inside the containers while it runs.
Why do we need containers?
--> Solves environment inconsistent issues - For ex: We have some python application, which built with version 3.10, when it needs to deploy in server must and should have same python dependencies. if not lets say server has 3.8 version of python, as a result latest dependencies been missed(may be some libraries, new features) eventually application will be crashed if installed.
Resolution: Docker solves this problem, As docker image has application code, libraries, dependencies , which can run using common OS --its nothing but container
-->Solves compatibility Issues- Usually to implement one functionality requires different Application involvement like web, app, database., all these has to work with same OS is very difficult previously. since docker containers shares underlined OS solves compatibility issues.
Comments
Join the discussionNo comments yet. Be the first to comment.
