Module 4 ยท Containers and environments Lesson 10 of 15
Docker: the same app everywhere
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".
Keep your place in this course
A free account saves which lessons you have finished and unlocks the certificate. The lesson itself stays free to read.
Create free account or sign inCourse complete
You finished every lesson.
Your certificate is ready, and the projects you built are the proof to attach to an application.
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.