Logo
Logo
Home
Archive
Advertise
YouTube
Login
Sign Up
  • Home
  • Posts
  • 🦥 Docker For Dummies

🦥 Docker For Dummies

Mar 25, 2026

Hello friends!

Welcome to this week’s Sloth Bytes. I hope you had an amazing week!

You don't remember that meeting. Nobody does.

I bet right now you couldn't tell me what your last meeting or lecture was about even if your life depended on it.

Don't worry, I can't either. I have the memory of a goldfish. That's why I started using Granola.

It picks up your meetings automatically and transcribes everything in the background while you take notes like normal. No bot joining your call, no “recording in progress” sound, nobody knows it's there.

After the meeting, it takes your messy notes and the full transcript and turns it into a clear summary of the meeting and what you actually need to do next.

You can even share that summary with your team because I bet they forgot too.

Now nobody has to pretend they remember.

Try Granola on your next meeting. Free for a month with code CODINGSLOTH.

Docker For Dummies

You’ve probably heard the classic joke: "It works on my machine."

Well that joke exists for a reason.

There’s lots of situations where code literally only works on your machine for some reason.

And I guess it happened enough to where a solution was needed. That solution was Docker.

What Even Is Docker?

Docker is a tool that lets you package up your application.

  • Your code

  • Your dependencies

  • Your config

Everything your app needs. It gets packaged into a single portable unit called a container.

You run it on your laptop, It works. Run it on a school computer, it works. Run it on a pregnancy test, it works.

Think of it like this:

Your app is a piece of IKEA furniture and Docker is the box it comes in. Every single part is in there. The instructions. The weird annoying hex key. All of it. Wherever you take that box, you can build the same thing.

Containers vs Virtual Machines

Some of you probably noticed that containers sounds similar to a VM.

Well…

  1. You’re a nerd

  2. You’re correct

Containers are similar to VMs, but there are small differences that trip people up every time, so let's quickly go over it.

A VM emulates an entire computer. This means it emulates its own operating system, its own hardware, everything. It's heavy, slow to start, and eats RAM like it's not $1000 (Thanks AI).

A container is different. It doesn’t emulate everything, instead they share the host machine's operating system kernel.

Without getting too technical and nerdy, a container creates it’s own room in your machine. That room is completely isolated. It has its own files, its own processes, but it’s sharing your machine's actual CPU and memory.

A VM is like renting a whole apartment. A container is just getting your own bedroom.

This means containers are faster and lighter than VMs.

Parts of each. Small differences.

The Key Concepts

There are really only three things you need to understand about Docker:

1. The Dockerfile

Think of a dockerfile like a recipe. It contains instructions that tells Docker how to build your app.

# Start from an official Python base image
FROM python:3.11-slim

# Set working directory inside container
WORKDIR /app

# Copy your requirements and install them
COPY requirements.txt .
RUN pip install -r requirements.txt

# Copy the rest of your code
COPY . .

# What runs when the container starts
CMD ["python", "app.py"]

2. The Image

When you build a Dockerfile, you get an image. An image is a frozen snapshot of your app and everything it needs. You can think of it like a class in OOP, it's the blueprint of a container.

docker build -t my-app .

3. Container

A container is a running instance of an image. If an image is the class, a container is the object. It’s the actual thing.

docker run my-app

These are the 3 steps you need to “dockerize” your app:

  1. Write the dockerfile

  2. Build it

  3. Run it

Pretty simple and useful.

You can spin up 10 containers from the same image. They all run the same app, totally isolated from each other.

Docker Compose

We only covered a baby example, so let’s get a bit more practical.

Real apps have multiple pieces. Could be a front-end, back-end, and database.

Now technically, you could put all those pieces into one giant docker container, but I wouldn’t recommend that and Docker doesn’t either.

Why? Because it defeats the whole point. If your database crashes, it takes your entire app down with it. If you need to scale your back-end, you'd have to scale the database too even if it didn't need it.

Each piece has a different job, so you should instead put each piece into it’s own container.

But managing three separate containers gets annoying fast.

This is why we have Docker Compose.

Docker Compose lets you define all of them in one file and spin them up together.

# docker-compose.yml
services:
  frontend:
    build: ./frontend # Location of that dockerfile
    ports:
      - "3000:3000"

  backend:
    build: ./backend # Location of that dockerfile
    ports:
      - "8000:8000"
    depends_on:
      - db

  db: # We don't use a dockerfile for this, so we have to build it!
    image: postgres:15
    environment:
      POSTGRES_PASSWORD: secret

And all it takes is one command to run everything:

docker compose up

That’s it. All 3 parts of your app are fully configured and running together. You don’t have to do anything else, it’s beautiful.

When Should You Use Docker?

Yes, use it when:

  • You're sharing code with a team

  • You're deploying to a server or the cloud

  • Your app has specific dependency versions that need to be consistent

  • You're tired of "works on my machine" ruining your life

  • You want to self-host

Probably skip it when:

  • It's a tiny personal script you'll only ever run yourself

  • You're just learning the basics of programming (don't add this complexity early)

  • Your team has zero DevOps knowledge and no time to learn (Docker gets complicated fast)

Why Devs Love It

Once you “Dockerize” your app, onboarding a new developer goes from hours of installing dependencies, running build commands and crying to only running docker compose up and getting a coffee while it builds.

Fun fact: Docker was released in 2013 and became so popular that it changed how most of the software industry thinks about deployment. Kubernetes a tool that orchestrates thousands of containers was built partly because Docker made containers so mainstream that companies needed something to manage them at scale.

TL;DR

Concept

What it is

Dockerfile

Recipe for building your app

Image

Frozen snapshot built from the Dockerfile

Container

A running instance of an image

Docker Compose

Tool to run multiple containers together

Why it matters

Same environment everywhere = no more "works on my machine"

Docker won't make your code better. But it will make sure the code you write actually runs the same way everywhere it goes.

If you’re a nerd and wanna learn more

  • The Only Docker tutorial You Need To Get Started - My tutorial

  • Official Docker Getting Started guide

  • Official Docker Guides

Thanks to everyone who submitted!

Manzolillom, kwame-Owusu, hamooo21112655, neilyneilynig, Nomekuma, iamsunildev, adnmzlz, sujitha483, Yaya9256, Ishaan282, and gcavelier!

Daily Temperatures

You are given an array of integers temperatures where temperatures[i] represents the daily temperatures on the ith day.

Return an array where output[i] is the number of days after the ith day before a warmer temperature appears on a future day. If there is no day in the future where a warmer temperature will appear for the ith day, set output[i] to 0 instead.

Examples

daily_temperatures([30,38,30,36,35,40,28])
output = [1,4,1,2,1,0,0]

daily_temperatures([22,21,20])
output = [0,0,0]

daily_temperatures([30,38,30,36,35,40,28])
output = [1,4,1,2,1,0,0]

How To Submit Answers

Reply with

  • A link to your solution (github, twitter, personal blog, portfolio, replit, etc)

  • or if you’re on the web version leave a comment!

  • If you want to be mentioned here, I’d prefer if you sent a GitHub link or Replit!

That’s all from me!

Have a great week, be safe, make good choices, and have fun coding.

If I made a mistake or you have any questions, feel free to comment below or reply to the email!

See you all next week.

What'd you think of today's email?

  • 🦥 Amazing! Keep it up
  • 🦥 Good, not great
  • 🦥 It sucked

Login or Subscribe to participate

Want to advertise in Sloth Bytes?

If your company is interested in reaching an audience of developers and programming enthusiasts, you may want to advertise with us here.

Reply

Avatar

or to participate

Keep Reading

envelope-simple

Join 50k+ developers and become a better programmer and stay up to date in just 5 minutes.

© 2026 Sloth Bytes.
Report abusePrivacy policyTerms of use
beehiivPowered by beehiiv