Latest / CyberSecurity Summary / Docker in Production: Lessons from the Trenches
Transcript
- 0:00Speaker 1: So if you walked into almost any tech company historically,
- 0:03Speaker 1: there was basically a war going on, a literal epic
- 0:07Speaker 1: turf war. Oh.
- 0:08Speaker 2: Absolutely, a total battleground.
- 0:11Speaker 1: Right, because on one side you had the software developers
- 0:14Speaker 1: and their entire job, I mean, their whole performance metric
- 0:17Speaker 1: was to just move fast, break things, and push continuous updates.
- 0:21Speaker 2: Yeah, just ship it exactly.
- 0:23Speaker 1: And then on the other side you had the operations team,
- 0:25Speaker 1: the knops folks. Their job was stability. They were essentially
- 0:29Speaker 1: the gatekeepers, and.
- 0:29Speaker 2: They were the ones holding the pager.
- 0:31Speaker 1: Right, So because they held that pager, their default answer
- 0:35Speaker 1: to you almost any new developer idea was just an
- 0:38Speaker 1: emphatic no.
- 0:39Speaker 2: Well, I mean it really was a necessary survival tactic
- 0:42Speaker 2: for them. Think about the stakes for an OPS engineer
- 0:45Speaker 2: back then.
- 0:45Speaker 1: Yeah, it was high stakes.
- 0:46Speaker 2: Huge. If a developer wanted to try out, say a
- 0:49Speaker 2: brand new, highly experimental library, and that code caused a
- 0:55Speaker 2: memory leak, oh man, the dreaded memory leaks, right, and
- 0:58Speaker 2: it brings down the entire server at two am. It
- 1:01Speaker 2: wasn't the developer getting out of bed, it was the
- 1:03Speaker 2: ops team waking up to all those alarms. So they
- 1:08Speaker 2: had to be defensive. The infrastructure just simply couldn't handle
- 1:11Speaker 2: that level of chaos.
- 1:12Speaker 1: And that tension is exactly what we're unpacking today. We're
- 1:15Speaker 1: doing a deep dive decoding the reality of running Docker
- 1:19Speaker 1: when real customers and you know, real money are on.
- 1:22Speaker 2: The line, which changes everything.
- 1:24Speaker 1: It really does. We're pulling from this fascinating book called
- 1:27Speaker 1: Docker in Production Lessons from the Trenches. And for you listening,
- 1:31Speaker 1: this isn't your standard like Hello World tutorial, No, not
- 1:34Speaker 1: at all. We're talking about the duct tape, the midnight alerts,
- 1:37Speaker 1: the really gritty reality of what happens when you actually
- 1:40Speaker 1: put this technology into production. Because Docker didn't just introduce
- 1:43Speaker 1: a neat technical.
- 1:44Speaker 2: Trick, No, it fundamentally shifted the culture.
- 1:46Speaker 1: It essentially forced a peace treaty in that epic dev
- 1:50Speaker 1: versus OPS war. Yeah, it completely changed the ops response
- 1:54Speaker 1: from no to yes as long as it runs in Docker.
- 1:57Speaker 2: Yeah. And that shift happened because Docker completely read to
- 2:00Speaker 2: find the blast radius of bad code.
- 2:02Speaker 1: The blast radius.
- 2:03Speaker 2: I like that, right, Let's look at the before picture.
- 2:06Speaker 2: In a traditional virtual machine setup, you might have say,
- 2:11Speaker 2: five different applications running on one operating.
- 2:13Speaker 1: System, right, all sharing the same space.
- 2:16Speaker 2: Exactly, So if one of those apps has a catastrophic failure,
- 2:20Speaker 2: it could crash the whole virtual machine. It takes the
- 2:23Speaker 2: other four instant applications down with it, which is a nightmare,
- 2:26Speaker 2: total nightmare. But with Docker, that bad code is tracked.
- 2:30Speaker 2: It is entirely isolated inside its specific container. So if
- 2:34Speaker 2: it crashes, only that container dies.
- 2:36Speaker 1: Wow.
- 2:37Speaker 2: The host server and all the other containers sharing that
- 2:39Speaker 2: server they just keep humming along completely unaware.
- 2:42Speaker 1: Okay, let's unpack this because getting to the point where
- 2:45Speaker 1: ops actually trust that isolation, that requires a massive mental
- 2:50Speaker 1: shift in how we even view our servers in the
- 2:52Speaker 1: first place.
- 2:53Speaker 2: Oh massive, It's a whole new paradigm.
- 2:55Speaker 1: Yeah. And the book uses this brilliant analogy from a
- 2:57Speaker 1: company called peer Space, detailing what they call the cattle
- 3:00Speaker 1: versus pets philosophy.
- 3:01Speaker 2: It is arguably the most critical mental model for modern infrastructure. Honestly,
- 3:07Speaker 2: I mean, if you've ever managed servers, you know.
- 3:09Speaker 1: What a pet is, right, you get attached.
- 3:11Speaker 2: You really do think about your stateful services, like your
- 3:15Speaker 2: massive relational databases or your search engines like elastic search.
- 3:19Speaker 2: Those are pets. You give them specific names, like you
- 3:22Speaker 2: know database primary era one.
- 3:24Speaker 1: Right, they have a caller and a tag.
- 3:26Speaker 2: Exactly because they hold precious, irreplaceable data. They require constant,
- 3:32Speaker 2: meticulous upkeep. And if a pet gets sick, you.
- 3:35Speaker 1: Call ve, you log in, you diagnose it.
- 3:37Speaker 2: Yes, you carefully nurse that specific machine back to health.
- 3:40Speaker 2: You cannot just delete your primary customer database and pretend
- 3:44Speaker 2: it didn't happen.
- 3:45Speaker 1: Yeah, that would be bad. But the other side of
- 3:47Speaker 1: the infrastructure is entirely different. You have your stateless services,
- 3:50Speaker 1: your web servers, the APR routers, the code that just
- 3:55Speaker 1: processes requests without actually storing anything permanently on its own
- 3:58Speaker 1: local hard.
- 3:59Speaker 2: Drive, right, and those are your cattle. They are completely nameless.
- 4:03Speaker 2: They don't store anything unique at all. So if they break,
- 4:05Speaker 2: if one of them starts acting up or get sick,
- 4:08Speaker 2: you absolutely do not nurse it back to health. You
- 4:11Speaker 2: don't even investigate it. Wow, just brutal it is. You
- 4:14Speaker 2: pull it out of rotation, destroy it, and immediately replace
- 4:17Speaker 2: it with an identical, fresh clone. And peer space just
- 4:20Speaker 2: embrace this entirely. They operate over twenty different micro services,
- 4:24Speaker 2: and almost all of them are treated as disposable cattle.
- 4:27Speaker 1: And the way they manage these disposable containers is shockingly
- 4:31Speaker 1: bare bones. I mean they just use static environment variables,
- 4:34Speaker 1: basically simple text strings telling the container like, hey, the
- 4:38Speaker 1: database is over here. Yeah, it's incredibly simple, and they
- 4:41Speaker 1: let standard Linux tools like systems manage them. And for
- 4:45Speaker 1: anyone less familiar, systemed is just the built in Linux
- 4:48Speaker 1: service manager that runs in the background to ensure programs
- 4:52Speaker 1: start up and stay running.
- 4:53Speaker 2: Right, it's just basic Linux plumbing.
- 4:55Speaker 1: But hold on, if they are literally typing in environment
- 4:59Speaker 1: variables and using basic Linux background commands to manage these cattle,
- 5:03Speaker 1: doesn't that defeat the whole purpose? Well, that sounds incredibly tedious,
- 5:08Speaker 1: like a massive recipe for human error. If someone has
- 5:11Speaker 1: to restart these things manually all the time.
- 5:13Speaker 2: Oh absolutely, If a human being were doing it by hand,
- 5:16Speaker 2: it would be a complete disaster.
- 5:18Speaker 1: Okay, good, I thought I was missing something.
- 5:19Speaker 2: No. No. The key takeaway from pure Space's approach is
- 5:23Speaker 2: that this simple static configuration is designed to be the
- 5:27Speaker 2: foundation for automation. Ah automation. Right, You don't have an
- 5:32Speaker 2: engineer typing those variables. You have a continuous integration and
- 5:36Speaker 2: continuous delivery system a CICD pipeline doing all the typing
- 5:40Speaker 2: for you.
- 5:40Speaker 1: Okay, that makes sense, But to get to.
- 5:42Speaker 2: A point where a machine can deploy these identical cattle
- 5:45Speaker 2: incredibly fast and automatically, you first need to understand their DNA.
- 5:49Speaker 2: You have to look under the hood at how Docker
- 5:51Speaker 2: images are actually constructed.
- 5:53Speaker 1: Which brings us to copy on write or COW. This
- 5:57Speaker 1: is where the efficiency really shines, right. It's the secret sauce,
- 6:01Speaker 1: because if your team was using traditional virtual machines and
- 6:04Speaker 1: you needed, say ten web servers, you'd have ten massive
- 6:08Speaker 1: duplicate copies of an entire operating system just eating up.
- 6:12Speaker 2: Your hard drives, which is incredibly.
- 6:13Speaker 1: Wasteful exactly, but Docker uses a layering system. Think of
- 6:17Speaker 1: copy on write, like those old transparent acetate sheets teachers
- 6:21Speaker 1: used to use on overhead projectors in school.
- 6:23Speaker 2: I love this analogy. The overhead projector is a fantastic
- 6:26Speaker 2: way to visualize the mechanics here.
- 6:28Speaker 1: Right, So the base operating system, let's say it's a tiny,
- 6:32Speaker 1: stripped down version of Linux. Is that bottom clear plastic sheet. Now,
- 6:37Speaker 1: if you want to add a mustache to a face
- 6:39Speaker 1: drawn on that bottom sheet, you don't take an eraser
- 6:42Speaker 1: to the base layer.
- 6:43Speaker 2: Right, You don't touch the base.
- 6:44Speaker 1: You just draw your mustache on a brand new totally
- 6:47Speaker 1: clear sheet of plastic and you drop it directly on
- 6:51Speaker 1: top of the first one. When the projector light shines
- 6:54Speaker 1: up through both sheets, you see the face with the mustache.
- 6:57Speaker 1: That is exactly how a Docker layer works.
- 6:59Speaker 2: And the storage savings are just astronomical. If you have
- 7:02Speaker 2: twenty different containers all running that same base Linux operating system,
- 7:06Speaker 2: Docker only stores that bottom transparent sheet once on the
- 7:09Speaker 2: hard drive. Wow, just once, exactly. Every single container shares
- 7:14Speaker 2: that exact same foundation, and they only add their own
- 7:17Speaker 2: incredibly lightweight mustache layers on top. It saves time, it
- 7:21Speaker 2: saves bandwidth, and it obviously saves disk space. Right. What's
- 7:25Speaker 2: fascinating here is, however, there is a very dangerous sized
- 7:27Speaker 2: trap hidden within these transparent layers.
- 7:30Speaker 1: The permanent marker trap, because you can't just erase things
- 7:33Speaker 1: once they're drawn.
- 7:34Speaker 2: Exactly. That's the danger of immutability. Images never shrink, never never.
- 7:40Speaker 2: Imagine on layer three your container needs to download a
- 7:44Speaker 2: massive five hundred megabyte compressed archive just to compile some
- 7:47Speaker 2: software from source.
- 7:48Speaker 1: Okay, pretty common.
- 7:49Speaker 2: Then on layer four, the compiling is done, so you
- 7:52Speaker 2: tell Docker to delete that temporary five hundred megabyte archive
- 7:56Speaker 2: from the top down. Looking through the sheets, the file
- 7:58Speaker 2: appears to be gone.
- 7:59Speaker 1: Because as the top sheet covers it up.
- 8:01Speaker 2: Right, But because layers cannot be altered once they are created,
- 8:04Speaker 2: that massive file is still permanently glued to layer three.
- 8:08Speaker 2: It is completely invisible to the application, but it will
- 8:10Speaker 2: be downloaded, transferred, and stored by every single server that
- 8:14Speaker 2: ever uses your image.
- 8:15Speaker 1: Oh man, that is brutal. So if the sheets are immutable,
- 8:19Speaker 1: you can't just delete it later. You would have to
- 8:21Speaker 1: somehow download the archive, extract it, compile a software, and
- 8:25Speaker 1: clean up all the garbage, all before that transparent sheet dries. Right,
- 8:28Speaker 1: you'd have to chain it all together into one single step.
- 8:31Speaker 2: You just describe the exact solution from the trenches. You
- 8:35Speaker 2: fix this by stringing your commands together using operators in
- 8:39Speaker 2: your docro file. Oh instead of using three separate ru
- 8:42Speaker 2: in commands you know, one to download, one to install,
- 8:45Speaker 2: one to clean up, you combine them into a single
- 8:48Speaker 2: long r ruin command. The file is downloaded, the software
- 8:51Speaker 2: is built, and the garbage is deleted, all during the
- 8:54Speaker 2: creation of a single transparent sheet.
- 8:56Speaker 1: That was so smart, and the sources emphasize that this
- 8:59Speaker 1: all star with choosing a tiny bottom sheet to begin with,
- 9:02Speaker 1: you wouldn't use a massive, bloated desktop operating system as.
- 9:06Speaker 2: Your base, No, that would defeat the purpose.
- 9:08Speaker 1: You'd use something purpose built for containers like Alpine Linux
- 9:11Speaker 1: or BusyBox, which are just phenomenally small. I mean, BusyBox
- 9:14Speaker 1: is literally two point five megabytes.
- 9:16Speaker 2: It's crazy.
- 9:17Speaker 1: It's wild to think you can run a production web
- 9:20Speaker 1: server on a foundation the size of a low quality
- 9:23Speaker 1: MP three from nineteen ninety nine.
- 9:25Speaker 2: The mineralism is really what makes the whole system viable.
- 9:28Speaker 2: And once your team has mastered building these tiny, highly
- 9:32Speaker 2: optimized images, you face the next operational hurdle orchestration. Exactly,
- 9:37Speaker 2: how do you actually take the old version of your
- 9:39Speaker 2: application down and put the new version up without dropping
- 9:42Speaker 2: a single user's connection?
- 9:44Speaker 1: Ah, the holy grail of zero downtime deployment. The book
- 9:49Speaker 1: highlights an amazing real world set up from a company
- 9:52Speaker 1: called relate Iq to achieve this, and honestly, given how
- 9:55Speaker 1: complex this sounds, you'd think they're running some massive, enterprise
- 9:58Speaker 1: grade cluster. Manager thinks, oh yeah, but their orchestration is
- 10:01Speaker 1: shockingly simple. It's literally a bashscript.
- 10:04Speaker 2: A simple basscript running on a kron job every five.
- 10:07Speaker 1: Minutes wait, just a kron job.
- 10:08Speaker 2: Yep, and a cron job is really just a basic
- 10:11Speaker 2: time based task scheduler built into Linux. Every five minutes,
- 10:15Speaker 2: it wakes up and asks is there a new version
- 10:17Speaker 2: of our web server available?
- 10:18Speaker 1: And if there is, it pulls down that tiny new image.
- 10:22Speaker 1: But how does it swap the traffic without users seeing
- 10:25Speaker 1: an error page? I mean, they don't want.
- 10:26Speaker 2: A four or four error right, So they use a
- 10:29Speaker 2: proxy called hippasche backed by a reddist database. Think of
- 10:33Speaker 2: that hipache proxy as a train switch operator.
- 10:36Speaker 1: Okay, I'm picturing it.
- 10:37Speaker 2: It sits at the front of the station directing all
- 10:39Speaker 2: the incoming user traffic. When that five minute kron job
- 10:43Speaker 2: pulls down the new container image, it spins it up
- 10:45Speaker 2: on the server alongside the.
- 10:47Speaker 1: Old one, so they're both running at the same time.
- 10:49Speaker 2: Yes, but crucially, the proxy doesn't send any user traffic
- 10:54Speaker 2: to the new container immediately.
- 10:55Speaker 1: Ah. It waits for a health check exactly. The script
- 10:58Speaker 1: actually tests the new container to make sure it's fully
- 11:01Speaker 1: booted up and breathing before putting.
- 11:03Speaker 2: It on the front lines. Once the hell check passes,
- 11:05Speaker 2: the bash script updates the reddest database. It pash monitors
- 11:10Speaker 2: that database instantly sees the new destination and immediately flips
- 11:14Speaker 2: the train tracks just like that. From that millisecond forward,
- 11:17Speaker 2: all new user traffic flows seamlessly into the new container, and.
- 11:21Speaker 1: They leave the old container running right next to it
- 11:23Speaker 1: for a little while, which is brilliant. Just in case
- 11:26Speaker 1: the new code has a weird bug that wasn't caught
- 11:28Speaker 1: in testing, they can flip the switch back instantly.
- 11:31Speaker 2: The rollback takes seconds instead of minutes.
- 11:34Speaker 1: That's huge.
- 11:35Speaker 2: It is in a traditional virtual machine environment, spinning up
- 11:38Speaker 2: a second copy of your server, ensuring it's stable and
- 11:42Speaker 2: manually switching dns or load balancers could take ten minutes
- 11:46Speaker 2: or more.
- 11:47Speaker 1: Which feels like an eternity during an outage.
- 11:50Speaker 2: With Docker, because the containers are so lightweight, the infrastructure
- 11:54Speaker 2: can pivot in milliseconds.
- 11:55Speaker 1: Here's where it gets really interesting though. Related Iq didn't
- 11:59Speaker 1: just use this architecture for zero downtime production deploys. They
- 12:03Speaker 1: use this exact same concept to create parallel universes for
- 12:07Speaker 1: their developers using awsban Stock.
- 12:10Speaker 2: Yes, by completely decoupling their web tier from their database tier,
- 12:14Speaker 2: they essentially created a playground. A playground.
- 12:17Speaker 1: I like that.
- 12:18Speaker 2: It's always one of the biggest bottlenecks in software development.
- 12:21Speaker 2: The staging environment q oh.
- 12:23Speaker 1: Right, waiting for your turn to test your code. So
- 12:26Speaker 1: imagine you're a UI designer on their team. You just
- 12:29Speaker 1: changed the CSS to make the checkout buttons blue instead
- 12:33Speaker 1: of red. You commit your code to a specific branch, Right,
- 12:37Speaker 1: the CICD system sees that automatically builds a brand new
- 12:40Speaker 1: Docker image just for your specific branch and spins up
- 12:44Speaker 1: a dedicated web container.
- 12:46Speaker 2: And because that web tier is entirely stateless, it's cattle right. Yeah,
- 12:50Speaker 2: it requires no special setup. It just boots up and
- 12:53Speaker 2: points itself at a staging database.
- 12:55Speaker 1: But the best part is with a quick change of
- 12:57Speaker 1: a single environment variable, that designer can point their isolated
- 13:01Speaker 1: test container at the actual production database.
- 13:04Speaker 2: Which is incredibly powerful.
- 13:06Speaker 1: Right, they can see exactly how their new blue buttons
- 13:08Speaker 1: look and function with real customer data flowing through the app.
- 13:11Speaker 1: But they aren't risking a single real user seeing their
- 13:14Speaker 1: test environment if it completely breaks.
- 13:16Speaker 2: It creates an incredibly tight feedback loop. I mean, a
- 13:19Speaker 2: designer or a product manager can sketch an idea, write
- 13:22Speaker 2: the code, and see it functioning in total isolation against
- 13:25Speaker 2: real data in under fifteen minutes.
- 13:27Speaker 1: That sounds like an absolute dream for a developer. But
- 13:31Speaker 1: and I have to ask, if it's really this easy
- 13:34Speaker 1: and perfectly isolated, why not just let every developer push
- 13:37Speaker 1: their containers straight to production whenever they want? Oh boy,
- 13:40Speaker 1: why do we still need OPS folks acting as gatekeepers?
- 13:44Speaker 2: Because OPS still owns the underlying platform and they own
- 13:48Speaker 2: the security of the host. Let's say the developer is
- 13:51Speaker 2: rushing to me to deadline, they find a tutorial online
- 13:55Speaker 2: and base their new container on an outdated Python image
- 13:58Speaker 2: from three years ago.
- 13:59Speaker 1: Oh where this is going?
- 14:00Speaker 2: Yeah, if you let them push that directly to production,
- 14:03Speaker 2: they've just introduced a container full of unpatched, highly exploitable
- 14:07Speaker 2: security vulnerabilities into your network. That's terrifying. OPS completely loses
- 14:12Speaker 2: control over what dependencies are running on their servers.
- 14:14Speaker 1: Which leads us straight into the reality check of security
- 14:17Speaker 1: in a containerized world. If you're giving developers the power
- 14:21Speaker 1: to package their own environments, you need serious guardrails on
- 14:24Speaker 1: the server side.
- 14:25Speaker 2: Absolutely. The foundational concept that everyone needs to grasp here
- 14:29Speaker 2: is that, unlike a virtual machine, containers share the host's kernel.
- 14:33Speaker 1: Right, the kernel being the absolute core brain of the
- 14:36Speaker 1: operating system, the part that actually talks to the physical
- 14:39Speaker 1: hardware exactly.
- 14:40Speaker 2: A virtual machine brings its own completely isolated kernel. It's
- 14:44Speaker 2: a fortress. But a docker container is ultimately just a
- 14:48Speaker 2: heavily restricted process running on the host server's brain. So
- 14:52Speaker 2: if it's breached, if a hacker manages to compromise your
- 14:56Speaker 2: application and they find a vulnerability in the shared Linux
- 15:00Speaker 2: kernel itself, they can break out of the container entirely.
- 15:03Speaker 2: Oh wow, they take over the entire host machine and
- 15:05Speaker 2: by extension, every other container running on that metal.
- 15:08Speaker 1: That is a massive threat. The sources actually mention a
- 15:11Speaker 1: paper from Google about their internal container system BORG and
- 15:15Speaker 1: it's very telling. Even Google, I mean, the pioneers of
- 15:18Speaker 1: this technology. They use full heavy virtual machines when they
- 15:22Speaker 1: are running untrusted external code.
- 15:25Speaker 2: Yes that detail is crucial.
- 15:26Speaker 1: They save their raw containers exclusively for their own highly trusted,
- 15:30Speaker 1: internally written applications.
- 15:32Speaker 2: When the engineers at Google don't trust a container boundary
- 15:36Speaker 2: to hold back a dedicated attacker that tells you everything
- 15:39Speaker 2: you need to know. The isolation is strong, but it
- 15:42Speaker 2: is not impenetrable.
- 15:44Speaker 1: To mitigate this, the book lists a bunch of security
- 15:47Speaker 1: don'ts to lock these containers down in production One major
- 15:51Speaker 1: rule is removing sued binaries from your images.
- 15:53Speaker 2: Ah.
- 15:54Speaker 1: Yes, SOUTH essentially stands for set owner User ID. It's
- 15:57Speaker 1: a special permission in Linux that allows a normal user
- 16:00Speaker 1: to execute a file with full root privileges temporarily, things
- 16:04Speaker 1: like the ping command or the mount command.
- 16:07Speaker 2: Use this right, which sounds harmless, but it's.
- 16:09Speaker 1: Not, and the logic is bulletproof. Why on earth does
- 16:12Speaker 1: a basic web server container need the ability to ping
- 16:15Speaker 1: other servers on the network or mount physical hard drives.
- 16:18Speaker 1: It doesn't.
- 16:18Speaker 2: No, it really doesn't. It is the principle of least
- 16:21Speaker 2: privilege applied to the extreme. You ruthlessly strip away any
- 16:25Speaker 2: capability the application doesn't strictly need to function, vastly reducing
- 16:29Speaker 2: the attack surface.
- 16:30Speaker 1: They also talk about kernel security frameworks like a parmer
- 16:33Speaker 1: or SELinux, though the author's joke that the most common
- 16:36Speaker 1: Google search for cylinicx is how to disable Sylinics.
- 16:39Speaker 2: Yeah, that's a very common joke in the ops.
- 16:41Speaker 1: Community because it's so hard to use, because.
- 16:43Speaker 2: Those frameworks are notoriously complex to configure, but they provide
- 16:48Speaker 2: mandatory access control at the kernel level. If you can't
- 16:51Speaker 2: implement Celinux, you should at least be utilizing Linux capabilities
- 16:56Speaker 2: right capabilities.
- 16:57Speaker 1: Instead of giving it container full root access, which is
- 17:00Speaker 1: like giving a stranger the master skeleton key to your
- 17:03Speaker 1: entire office building, you grant them one very specific capability,
- 17:08Speaker 1: exactly like natadmin. They get the key to the networking closet,
- 17:12Speaker 1: but they absolutely cannot open any file system doors.
- 17:15Speaker 2: Which brings us to the most emphatic, non negotiable rule
- 17:19Speaker 2: in the entire book. It is written in all caps
- 17:22Speaker 2: for a reason.
- 17:23Speaker 1: Right, do not run SSH in your containers.
- 17:26Speaker 2: Yes, it completely violates the philosophy of immutable infrastructure.
- 17:30Speaker 1: It really does, and for anyone listening, SSH is how
- 17:33Speaker 1: you remotely log into a service command line to look
- 17:36Speaker 1: around or fix things. Ssaging into a Docker container to
- 17:39Speaker 1: troubleshoot is like popping the hood of your car while
- 17:42Speaker 1: flying down the highway at seventy miles an hour to
- 17:44Speaker 1: check the oil.
- 17:45Speaker 2: That is exactly what it's like.
- 17:46Speaker 1: You shouldn't be under the hood, you should just be
- 17:48Speaker 1: looking at the dashboard telemetry.
- 17:50Speaker 2: But this raises an important question. If you forbid engineers
- 17:53Speaker 2: from popping the hood and a container crashes in production,
- 17:57Speaker 2: how do you actually diagnose what went wrong? Right?
- 18:01Speaker 1: You still need to know what happened telemetry and log mapping.
- 18:05Speaker 1: You never store the application logs inside the container itself.
- 18:09Speaker 2: No, never.
- 18:09Speaker 1: You can figure Docker to map a volume, so the
- 18:12Speaker 1: container is actually writing its logs directly to the host
- 18:14Speaker 1: machine's hard drive. Then the host machine scoops up those
- 18:18Speaker 1: logs and shicks them off to a central dashboard. Like
- 18:21Speaker 1: Splunk or some logic.
- 18:22Speaker 2: The container remains entirely disposable. If it crashes and burns,
- 18:27Speaker 2: the crucial diagnostic logs survive safely on the host. It
- 18:30Speaker 2: is brilliant an engineer can analyze what happened from their
- 18:33Speaker 2: central dashboard without ever needing to SSH into a fragile,
- 18:37Speaker 2: dying container.
- 18:39Speaker 1: So what does this all mean? If we follow this
- 18:42Speaker 1: logic to its conclusion. If the container is this perfectly
- 18:45Speaker 1: sealed black box where we only extract logs from the outside,
- 18:48Speaker 1: it completely changes how we think about the inside.
- 18:51Speaker 2: It really does.
- 18:52Speaker 1: What happens to all those configuration tools we used to
- 18:54Speaker 1: rely on for a decade. Tools like chef, Puppet and
- 18:58Speaker 1: antsible were the undisputed kings of configuration management. If the
- 19:03Speaker 1: Docker image handles all the application dependencies, what do those
- 19:07Speaker 1: tools even do now?
- 19:08Speaker 2: Well, they suffer a major demotion. Really Yeah, the entropy,
- 19:12Speaker 2: you know, the chaos of changing dependencies, library updates, and
- 19:15Speaker 2: application code has been successfully contained inside the Docker image.
- 19:20Speaker 1: So chef and Puppet are practically out of a job.
- 19:23Speaker 2: I wouldn't say they are unemployed, but their scope is
- 19:25Speaker 2: vastly reduced. Instead of intricately configuring every delicate detail the
- 19:30Speaker 2: application environment, they are now mostly relegated to simply preparing
- 19:33Speaker 2: the bare metal host machine. Oh I see, they install
- 19:36Speaker 2: the base operating system, they install the Docker demon and
- 19:39Speaker 2: they configure the logging agents. They prepare the soil, but
- 19:42Speaker 2: Docker plants the.
- 19:43Speaker 1: Seeds, which brings us to the actual soil, the metal itself.
- 19:47Speaker 1: Where does all this data physically live? The sources get
- 19:50Speaker 1: into the gritty reality of storage drivers, specifically comparing two
- 19:54Speaker 1: major options, AUFS and device.
- 19:57Speaker 2: Mapper, and this is exactly where academic theory meets hard
- 20:01Speaker 2: operational reality. Yes, AUFS is incredibly fast, it's the default
- 20:06Speaker 2: in many setups, and it handles that transparent copy on
- 20:09Speaker 2: right layering we talked about very efficiently. The problem is
- 20:13Speaker 2: it has a massive political issue.
- 20:15Speaker 1: It's not in the mainline Linux kernel exactly.
- 20:17Speaker 2: It was never officially merged into the core Linux codebase,
- 20:21Speaker 2: which means, depending on which version of Linux your company uses,
- 20:24Speaker 2: you might have to heavily hack your system to make
- 20:27Speaker 2: AUFS work, or it might not be supported by your
- 20:30Speaker 2: vendor at all.
- 20:31Speaker 1: So Ops teams naturally turn to the alternative device mapper
- 20:34Speaker 1: because it's native, it's built right into Linux. But the
- 20:37Speaker 1: book warns of a massive.
- 20:38Speaker 2: Trap here, a huge trap, a trap that has caused
- 20:41Speaker 2: countless midnight outages. Yeah. By default, Device mapper utilizes sparse
- 20:47Speaker 2: files also known as loopback devices, for its data and
- 20:50Speaker 2: metadata storage.
- 20:51Speaker 1: Okay, we need to define this because it sounds harmless.
- 20:53Speaker 1: A sparse file is essentially a trick. It's a file
- 20:57Speaker 1: that pretends to be huge, say one hundred gigabytes to
- 21:00Speaker 1: the application, but it only actually allocates physical space on
- 21:04Speaker 1: your real hard drive at the exact moment the application
- 21:07Speaker 1: tries to write new data to it.
- 21:08Speaker 2: It's a form of thin provisioning that relies on the
- 21:11Speaker 2: existing file system, and it is catastrophically slow. Catastrophically yes,
- 21:16Speaker 2: every single time your container needs to write a new
- 21:18Speaker 2: piece of data, the entire system has to pause. It
- 21:22Speaker 2: has to ask the physical hard drive for a new
- 21:24Speaker 2: block of storage. Way for it to be allocated and
- 21:26Speaker 2: only then write the data.
- 21:28Speaker 1: Wow, that sounds inefficient.
- 21:29Speaker 2: In a high traffic production environment, that constant pausing to
- 21:33Speaker 2: allocate new blocks completely destroys disk performance. It will bring
- 21:37Speaker 2: a busy database to its absolute knees.
- 21:39Speaker 1: So the crucial lesson from the trenches here is about
- 21:42Speaker 1: true thin provisioning. If you are forced to use device mapper,
- 21:45Speaker 1: you absolutely must configure it to use real, dedicated physical
- 21:49Speaker 1: block devices. Yes, always so handing it a raw, unformatted
- 21:52Speaker 1: chunk of your hard drive directly so it manages the
- 21:55Speaker 1: space natively instead of using those painfully slow default loop
- 21:59Speaker 1: back files.
- 22:00Speaker 2: Exactly. Never trust the default settings and production without completely
- 22:04Speaker 2: understanding the underlying mechanisms.
- 22:06Speaker 1: We have covered some serious ground today. I mean, we
- 22:08Speaker 1: started with the epic dev versus ops turf for and
- 22:12Speaker 1: saw how Docker's cattle versus pet's mentality acted as the
- 22:15Speaker 1: ultimate peace.
- 22:16Speaker 2: Treaty, a very necessary treaty.
- 22:18Speaker 1: We looked at how to build incredibly efficient copy on
- 22:21Speaker 1: right layers, chaining those r in commands before the transparent
- 22:25Speaker 1: sheet drives. We explored zero downtime routing with simple proxies,
- 22:30Speaker 1: the reality of locking down shared kernel security by dropping
- 22:33Speaker 1: root capabilities and banning SSH and finally navigating the performance
- 22:38Speaker 1: traps of storage drivers.
- 22:39Speaker 2: It is a fundamentally different paradigm for infrastructure. It forces
- 22:43Speaker 2: engineering teams to build systems that are entirely disposable, heavily isolated,
- 22:48Speaker 2: and ruthlessly automated.
- 22:50Speaker 1: But I want to leave you with a final sort
- 22:52Speaker 1: of mind expanding thought. While reading the author bios in
- 22:55Speaker 1: the text, specifically looking at Justin Kormack's work, there is
- 22:59Speaker 1: a massive hint the next evolution of all this.
- 23:01Speaker 2: Oh this is good.
- 23:02Speaker 1: We've spent this entire deep dive talking about how containers
- 23:05Speaker 1: abstract the application away from the operating system.
- 23:07Speaker 2: Right, they make this specific operating system irrelevant to the
- 23:10Speaker 2: software developer.
- 23:12Speaker 1: But what happens when we remove the operating system entirely?
- 23:15Speaker 2: Wait? What?
- 23:15Speaker 1: There is an emerging concept in computer science called unkernels.
- 23:20Speaker 1: Imagine if your application code and the absolute bare minimum
- 23:24Speaker 1: operating system components. I'm talking just the specific networking and
- 23:27Speaker 1: hardware drivers. It needs nothing else. We're compiled together into
- 23:31Speaker 1: a single, hyper fast, highly secured, disposable entity.
- 23:35Speaker 2: That is wild.
- 23:36Speaker 1: No extra baggage, no SSH, no PIN commands, no unused
- 23:40Speaker 1: USPE drivers, just your code and exactly what it needs
- 23:43Speaker 1: to run directly on the bare metal server. If Docker
- 23:46Speaker 1: made the traditional OS irrelevant to developers, well, unkernels might
- 23:50Speaker 1: make the traditional OS irrelevant entirely.
- 23:53Speaker 2: That is a fascinating trajectory. It takes the isolation, the security,
- 23:56Speaker 2: and the minimalism of containers to as absolute logical excas.
- 24:00Speaker 1: Something for you to ponder on your own as you
- 24:02Speaker 1: look at your team's infrastructure this week. Thank you so
- 24:05Speaker 1: much for joining us on this deep dive. Hopefully, the
- 24:08Speaker 1: next time you sit down with your debonops teams, you're
- 24:10Speaker 1: building peace treaties instead of throwing servers at each other.
- 24:14Speaker 1: We'll be back to explore the cutting edge of tech
- 24:16Speaker 1: with you next time.