Hacker News new | ask | show | jobs
by throwawaylala1 1335 days ago
> Also, since you’re probably deploying containers to production, it’s useful to have a similar environment for local development so that you know what will actually happen in production.

This such a complete and utter lie and I'm surprised people in 2022 still believe it.

You do know what's happening when you run Docker on your Macbook, right? Right?

2 comments

Ignoring your tone, here’s a concrete example: I was debugging a HTML-to-PDF service that was crashing for some payloads, but I couldn’t reproduce the problem locally.

I used Docker to run the application using the exact same image that was deployed to production, and was able to replicate the issue.

Why? Because the PDF renderer depended on loads of finicky dependencies (e.g. linked libraries), and it turns out that the default fonts in our base image didn’t support the Unicode code points in the example payload. I couldn’t replicate this outside of Docker because I have a completely different set of linked libraries and don’t stack.

Happy to answer any questions you have.

you always have that option though and i assumed it was a fairly common debug thing to have to do if you use docker enough. not just for the times it works (ie you find a bug between the layers) but for all the times it isn't the culprit.

the other post mentioned setup, so i thought he meant they imposed presetup containers for developers to use?

> You do know what's happening when you run Docker on your Macbook, right?

A Linux vm spawns a process with new namespaces - which is often exactly what happens in production as well.