Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Super easy for new team members to get started on a project. No need to manually install dependencies.

I see this brought up a lot as an argument. So why do we want this? How often do people switch companies? Once every 3 years on average or something? Getting your development env setup takes what, a few hours max on 3 years?



It depends on how large your organization is and what specific quirks need to be configured to do your work.

Its not unusual for large organizations to have internally hosted registries (Artifactory), source control and network proxies. This usually requires setting up different config files (.npmrc for Node.js/NPM), installation of custom root certificates, ssh keys, etc. None of that includes project/team specific configurations and workflows.

Take all that and multiply it by thousands of developers and you have a recipe for an endless stream of Slack chats, email chains, and Teams messages repeating the same config questions and answers.

If you can reduce all that down to a single docker pull, while making sure everyone's development environment is consistent, it can be a big win.


It can be much more complicated than that.

* You want means to keep all of the dev environments in sync so you don't get "works on my machine" problems.

* If you update something, then you need a way for everyone to have their environment reconfigured.

* As the number of projects/stacks/developers scales this becomes a bigger and bigger issue.

I've used some Anisble in combination with a shell script wrapper to handle some of this kind of stuff. Even still, it takes a lot of hands on support to make it all work. So, if you can get something like this to scale, it might be a big win ... if...

(edit formatting.)


Ok, now I'd like to update a dependency.

In docker world, I create an MR that updates the dev container and deploy container dockerfiles at the same time, check that it runs tests, and merge it in. I push a new version of the dev dockerfile, and have the .vscode/devcontainer.json reference that new tag. Next time all the devs open up this repo, they'll get notified they need an update. You just updated a dev dependency across the whole group in a source-controlled way.

What's your way to do it? Email everybody?


Fair point. It still comes up only a few times in a year. Most of the time I work with code bases that have most dependencies defined in some sort of package file (Gemfile, package.json, etc)

Updating a postgres version comes to mind as one of the possible differences and that usually only is an issue when working with pg_dump and pg_restore with different versions.

Good point nonetheless. I am not sure whether it is worth the work to maintain dev containers and the performance hit you get vs running a database directly for example.


> So why do we want this?

Just yesterday, I ran into an issue where a set of node unit tests were failing. My college and I were both getting failures, but different failures. The reason was: Different versions of Chrome, and thus different versions of the chrome integration plugin.

Given that we have effectively no control over Chrome's auto-updates, we'll never have truly identical development environments. A container with headless chrome would have resolved this for us.


But your customers still have widely varying versions of Chrome. So while your test might work, your code is still broken. Or did I misunderstand?


It's purely a test fixture setup that's failing because of a need for lockstep Chrome and the Chrome test fixture versions in Node. So, the code isn't broken for customers, just the local testing story.


It depends on your context. I've worked places that onboard new team members every few years, and I've worked places that onboard new team members every few weeks.

On larger teams, setting up a consistent environment like that also makes it easier for developers to collaborate. I've had experiences where attempts to pair program or share utility scripts generally stumbles and fails due to everyone's environment being a special snowflake.


But you can easily switch projects in-company, take a look at the one next cubicle etc. You switch machines. You decide work from home etc.


I like the fact that I can switch to/from different computers quickly. I have a desktop and a laptop that I routinely use. If I change something in a devcontainer[1], then I can move between the two easily. This actually happened to me earlier in the week.

[1] syncing the changes is left as an exercise to the reader, but I use a common git repository.


Not how often people switch companies but how often people work on different projects. Someone working on multiple projects can waste a lot of time keeping up with the environment of each project.


Sure, that sound like a good reason. Thanks.


> I see this brought up a lot as an argument. So why do we want this? How often do people switch companies?

It's not about you. The people coming in generally need confirmation and help when setting up their environments. Someone there would have to take time out of their day to help you. A few hours, a few days, a few weeks, a few deleted companies (https://news.ycombinator.com/item?id=11496947).

Here's an even more fun one: https://news.ycombinator.com/item?id=14476421


It also makes it easy to make changes and get it out to everyone on the team in an automated way.


Someone else raised the same point and I responded a bit differently, but I don't really have any experience with lots of these changes that really matter in many projects. Sure sometimes a version of imagemagick is fucky, but that happens so infrequently that I don't think it justifies running everything in docker.


I think you're really sleeping on the benefits of being able to spin up and change an environment easily.

Its easy to load a container with some stored test state. Its easy to load a completely fresh environment. Its easy to run multiple instances of things (with docker compose).

Its easy to totally shutdown the environment.

Its easy to work on different branches with different/conflicting dependencies and juggle containers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: