๐Ÿ“Š We use cookies & analytics to improve your experience. Learn more
Latest

Cloud, Linux & DevOps Basics Module 4 ยท Lesson 10 of 15

0% Exit to course

Module 4 ยท Containers and environments Lesson 10 of 15

Docker: the same app everywhere

Learning objective

A container packs the app with the exact versions of everything it needs, so it behaves the same on your laptop and the server. That is the whole point: no more "works on my machine".

Worked example

docker run -p 3000:3000 app runs the image and maps the port; the Node version inside is fixed by the Dockerfile, not by whatever is on the host.

Your practice task

Write a Dockerfile for a small Node or Python app, build the image and run it with a mapped port.

Do this before moving on. Reading a solution teaches the shape of it; typing it teaches you.

Key takeaway

A container packs the app with the exact versions of everything it needs, so it behaves the same on your laptop and the server. That is the whole point: no more "works on my machine".

Create free account or sign in

Almost there

15 lessons left of 15

Finish every lesson to unlock the certificate. Each one ends in a practice task โ€” do them and the final project brief writes itself.