Ravindra BagaleCourses & study guides मराठी

Chapter 6: Why Docker, Images and How a Container Is Created

6.1 Why the app should not be installed straight on the EC2

Why it matters. An EC2 instance is a computer. You can SSH in and install PHP, a library and MySQL with the package manager. Small demos work. The next month hurts.

Suppose we are shipping an Instagram-style badge page. The page is PHP. It reads badge rows from MySQL. A developer on a laptop installs PHP 8.3 and an image library (the kind that resizes the badge icon). It works. Operations — the server-side employee — gets the same files on an EC2 that already hosts an older internal tool on PHP 8.1. The package install upgrades a shared library. The old tool breaks. The badge page still fails because the laptop had a header file the server never got. Both sides say the same sentence: "It works on my machine."

Same week, a Netflix-style update: a small badge-text change must go out and, if the text is wrong, must come back in minutes. On the EC2 the deploy was "git pull and restart the service" plus a hand-edited config file nobody copied into Git. Rollback means remembering which files were overwritten. There is no tag that is the previous app.

Then an Infosys client project. You hand the client a README of install commands. Their operations employee runs them on the client server. One package name differs. The badge page is up on your laptop and down on their server. The meeting is a blame meeting: developers say the server is wrong, operations says the app is wrong. Nobody can point at a single artifact both sides ran.

Pain on a raw EC2 install What you feel
Shared libraries One app's install changes another app
"Works on my laptop" Laptop packages and the server packages drifted
Many apps, one OS They fight over PHP version, ports and config
Rollback You undo edits by memory
Dev vs operations No object both people can say "run this"

Ravindra Bagale's Tip

Interview madhe fakt "Docker is lightweight" sangu naka. Library clash, rollback, same artifact — he problem aadhi sang. Lakshat theva!

Ravi Sir's Cards for this lesson

मराठी cards