DEV Community

Cover image for Docker: Explained to a 5 year old. 👶🏻

Docker: Explained to a 5 year old. 👶🏻

Dhravya on March 16, 2022

When I was starting out with docker, everything was really difficult for me to figure out. But don't worry. I'm here 😉 Docker is an AMAZING tool ...
Collapse
mtwn105 profile image
Amit Wani

Wish someone could have taught me like this when I was 5 😁 Awesome🚀

Collapse
dhravya profile image
Dhravya Author

thanks a lot!

Collapse
mohamedtammam profile image
Mohamed Abdallah

Docker wasn't there when you were 5 😂

Collapse
rahulkumarmalhotra profile image
Rahul Kumar

Thank you so much for this tutorial.

Collapse
mgonzalo profile image
Gonzalo Muñoz

Dude!! I got to confess: today I won a battle against prejudice.
When I saw "16yr old" on yet another dev blog, I was about to nope outta here (I've had bad experiences before)
But something made me stay. I couldn't put my finger on it at first, but it turns out that you really have a knack for explaining things (not the same as writing about something). I loved the clean and concise style and even some figures like the one with the bee.
I'm almost twice your age, but today I learned from you.
Keep up the good work, and never stop growing!

Collapse
dhruv194 profile image
Dhruv Mehta

Damn bro! You are just 16 years old but you explained what Docker really is in a way like you have been learning docker since you were born XD
Very well done. I am really very impressed.

Collapse
just_moh_it profile image
Mohit Yadav

Haha, really!

Collapse
marcomoscatelli profile image
Marco Moscatelli

I am learning this concept right now and this explanation was very helpful

Collapse
dhravya profile image
Dhravya Author

thank you for the feedback!

Collapse
njmsaikat profile image
Saikat Roy

Wow Really Great Explained. when I first started faced a lot of difficulties to just imagine those basic things.

Collapse
dhravya profile image
Dhravya Author

I know, right! Same with me. I used to try to watch these tutorials which would be lengthy and still ended up confused with the basics

Collapse
annetawamono profile image
Anneta Wamono

Your post makes me want to start messing around with Docker. Thank you for your very approachable introduction to Docker.

Collapse
dontfixyourpc profile image
Richard Rhein

Awesome explanation, good idea to explain in simple words, so that everybody can understand this.

Collapse
paimanrasoli profile image
paiman

Nice explanation 😍

Collapse
dhravya profile image
Dhravya Author

Thanks a lot!

Collapse
devanica profile image
devanica

Finally someone said it, and in a way that I understand it. There are tutorials for everything but publishing APIs and other "little things" gave me a lot of headaches!

Collapse
dhravya profile image
Dhravya Author

Thank you! Glad I could help

Collapse
thegreytangent profile image
thegreytangent • Edited on

This is the most precise basic explanation about docker.

Collapse
dhravya profile image
Dhravya Author

Thanks a lot! Glad you liked it

Collapse
tqbit profile image
tq-bit

But it works on my machine

Then we'll ship your machine

Got me good. Noted.

Collapse
just_moh_it profile image
Mohit Yadav

Awesome explanation, and congrats for this article's hotness 😁 Well deserved 😃

Collapse
dhravya profile image
Dhravya Author

Thank you very much!

Collapse
_leticiaberry profile image
Leticia Berry

Very clear explanation. Thank you!

Collapse
diballesteros profile image
Diego (Relatable Code)

Really nice explanation!

Collapse
pawanprateek16 profile image
pawanprateek16

Very useful and Helpful informative.

Collapse
ckvignesh profile image
Vignesh

Hey this is an awesome article. Great way to put things in an easy-to-understand format.

Collapse
mfurmaniuk profile image
Michael

Love the "explain to a 5 year old" memes

Collapse
dhravya profile image
Dhravya Author

hahah yeah, it's not really for a 5 year old

Collapse
svgatorapp profile image
SVGator

Super helpful :D Awesome of you to share

Collapse
devibhattaraii profile image
devibhattaraii

Oooh this explanation is amazing!

Collapse
usmangq12 profile image
usmangq12

Thank you. This article has cleared a lot of my confusions related to Docker. I really appreciate it.

Collapse
hiweus profile image
Andre Alves Leocadio

Nice explanation 😁

Collapse
jacksonkasi profile image
Jackson Kasi

wow! nice 🤗

Collapse
dhravya profile image
Dhravya Author

Thank you!

Collapse
mirzafay profile image
Mirzafaisal

I have no words to describe. this is the best and simple explanation of docker!
i was so confused about containers. thanks alot!!

Collapse
chaocyu profile image
Chao

Awesome post. Do you think Docker is good for local development ? I'm definitely sold that for deployment it is awesome. For local dev, although it saves some environment settings hassles, everything we do now need to be through docker. so far I felt a bit overkill to use docker for local dev environment. appreciate your thoughts!

Collapse
dhravya profile image
Dhravya Author

For local development, yeah, it's not ideal. But for stuff like keeping multiple background processes online, (like running an API on computer when it's on), is an ideal use-case for docker desktop because then you can have multiple stuff running in the background with the minimum memory usage and no hassle of setting it up to run automatically and stuff

Collapse
bherbruck profile image
bherbruck

If you use vscode, check out devcontainers. They changed my life. I never develop on my host OS and ALWAYS in a devcontainers now.

Collapse
dhravya profile image
Dhravya Author

Yes, I checked it out too. They are really good

Collapse
photostockedit1 profile image
Photostockeditor

Thanks!!!

Collapse
techiedoctor profile image
Oluka Isaac

This is awesome

Collapse
bobbyiliev profile image
Bobby Iliev

Great post! well done! 🙌

For anyone interested to learn more, I could suggest this free eBook here:

GitHub logo bobbyiliev / introduction-to-docker-ebook

Free Introduction to Docker eBook

💡 Introduction to Docker

This is an open-source introduction to Docker guide that will help you learn the basics of Docker and how to start using containers for your SysOps, DevOps, and Dev projects. No matter if you are a DevOps/SysOps engineer, developer, or just a Linux enthusiast, you will most likely have to use Docker at some point in your career.

The guide is suitable for anyone working as a developer, system administrator, or a DevOps engineer and wants to learn the basics of Docker.

🚀 Download

To download a copy of the ebook use one of the following links:

📘 Chapters

🌟 Sponsors

Thanks to these fantastic companies that made this book possible!

Collapse
sixman9 profile image
Richard Joseph

You've made me sad, and I haven't read this yet (I will). Why? Because, for some unknown reason, I was thinking of writing something like this, on Docker, only last week, I was going to call mine "Explain Docker to me like I'm 5 years old", this is not a joke, I will get over it 😭

Collapse
kkbava profile image
Krishna Kishore (KK)

Good introduction, but I dont agree with the title! A 5-year old wouldnt have learnt anything from this post - probably great for a developer with 1 year experience?
Wish you had written some lines explaining WHY a containerization is needed - what problems existed before!
Overall, this is a great short intro to getting started! Thanks!

Collapse
dhravya profile image
Dhravya Author

Hi there! Thanks for your feedback. The title is just a metaphorical way of saying "in easy terms", and not for a real 5 year old. It's common to see such posts in DEV community

Collapse
liviufromendtest profile image
Liviu Lupei

Well done!
You explained it in such a simple way, while including code and technical details.

I remember some former colleagues talking in 2014 about Docker and saying how it would make life easier for DevOps and Devs.

And the next year I started endtest, to make life easier for testers as well.

Collapse
dhravya profile image
Dhravya Author

Thank you!

Wow, endtest is awesome! definitely will check it out

Collapse
tbhaxor profile image
Gurkirat Singh • Edited on

Nice post. I have increased its visibility already. Shameless promotion just in case anyone want to learnt how to create base images using docker scratch or directly from linux filesystem.

tbhaxor.com/create-docker-base-image/

Collapse
star_trooper profile image
Atharva Shirdhankar

Awesome Write up and explaination 🔥🚀.
One thing I want to say it's not that important but the file name will be .Dockerfile right
It's written app.py for Dockerfile code snippet/image.

Collapse
dhravya profile image
Dhravya Author

oh yes, my bad. It's supposed to be called Dockerfile. I'll correct the mistake. Thanks for pointing it out!

Collapse
jareer profile image
Jareer Abdullah

Really impressive explaination, But woundn't there be a collision between the cloned app and the original image, how can both run on port 5000?

Collapse
dhravya profile image
Dhravya Author

it wont run both the container and your original app. but yes, if you manually do it, there will be a collision and only throne that ran first will work (the other will error out)

Collapse
jareer profile image
Jareer Abdullah

How can we fix this error, is there a way to alter the port for the clone?

Thread Thread
dhravya profile image
Dhravya Author

You can map the container's port to your device's port (Which can be anything you want)
so instead of -p 5000:5000 which maps the container's 5000 to your computer's 5000, you can do something like -p 5001:5000 which will show the 5000 port in the container, on 5001

Collapse
iamfutureflash profile image
PUNEET VAISHNAV

Good explanation

Collapse
adesoji1 profile image
Adesoji1

Thanks, simple explanation

Collapse
thyezoliveira profile image
Thyez de Oliveira

Thank you.

Collapse
msp99000 profile image
MiKee

Great beginner friendly tutorial man
Good work

Collapse
laidah profile image
laidah

Thank you so much for the lovely and simple explanation! It helped me to conquer my fear of using docker.

Collapse
gemathus profile image
Gerardo Mathus

Great post 👏👏👏! Cheers