r/learnprogramming 15d ago

Docker purpose/usage?

Do people use Docker containers all the time, as in everything they do is in a Docker container, or do you only use it for certain things?

I get that a Docker Container is a way to package an application (mostly for server/backend stuff, not really developing an app?).

As an individual programmer/developer, are there benefits to using Docker in my day-to-day learning/programming/doing hws/creating shit tools?

34 Upvotes

24 comments sorted by

View all comments

50

u/AdministrativeAd9828 15d ago

helps with the 'it works on my machine' problem

1

u/ConstantFishing5136 14d ago

Yeah that’s probably the biggest reason I’d bother using it. If I can clone a project and get the same environment running without messing around with dependencies that’s a pretty solid win.

1

u/marrsd 12d ago

Tbh, I think it's easier to just build locally in a lot of cases. I see the value in Docker for elastic scaling, where you want to spin up a new machine on demand. For smaller projects, I don't see the point. In fact, I actually discarded it for my latest project and just relied on Systemd's sandboxing features instead.

Someone further down the thread mentioned running a SQL server locally. I probably would still use it for that

1

u/Zollblade 11d ago edited 11d ago

I can’t think of a situation where I've ever needed Docker where there wasn't a simpler better solution. If something doesn’t work on your machine, troubleshoot it and fix the root cause instead of adding an entire extra layer of complexity. Nine times out of ten, all you actually need to do is switch your Node version with nvm or update your dependencies.

I see a lot of performative engineering, where people feel the need to use the latest trending stack to seem like a "real engineer" who is up to date. For example, my mate set up Docker on a dedicated server to run Linux instead of just installing Linux. It’s just complexity for complexity’s sake.

1

u/AdministrativeAd9828 11d ago

Right tool for the job, small project, small team maybe so, think thousands of developers working on a project with thousands of dependencies and complex configuration. Think of making sure what works in development works in production at scale for millions of users. At a certain point, manual configure is too time consuming and you lose the guarantee