Live data from Hacker News

Ask HN: Do you use a dev container and why?

news.ycombinator.com

11–16 of 16 posts

Re: Ask HN: Do you use a dev container and why?

#11
At work I use whatever my team uses. For personal/side projects I tend to use either a VM or a Docker container for dev purposes. The main reasons are:

- a bit more of security. If I download a third-party dependency and it turns out that it executes `rm -rf /` in the background, well, only my container will result destroyed and not my personal machine. For serious malware, well, I guess it doesn't matter if I use containers (but I'm less concerned about this because being that paranoid would make my side projects feel like work)

- all the tooling gets installed in the VM/container, so my personal machine doesn't get polluted with gdb, pdb, compilers, linters, modules, packages, etc.

- I have a Mac, so I usually work on Linux VMs/containers

Re: Ask HN: Do you use a dev container and why?

#12
Just use it if you find the need and it's the right tool for the job at hand.

As a tester I use containers for setting up clean test environments, when writing code I use it to get the latest and greatest dev environment from a common depot and on CI platforms it is useful to get all the tools and environment you need setup for you.

It works for every language, some are easier to set up than others though, I never got a debugger to work in a container but never had the need to.

It's best to use the same image for dev test and prod, but not the same running container.

Re: Ask HN: Do you use a dev container and why?

#14
Docker is very convenient when it comes to maintaining uniformity across different developers machines. Once the boilerplate is done, 'docker compose' will stand up complex projects in a matter of minutes (depending in machine/internet speeds). Every startup that I have worked at uses docker and, honestly, I would question why one wouldn't want to use it.

Most of my work has involved rails or golang. Live debugging of go isn't really a thing. Rails on the other hand is usually done via a gem where you manually type in breakpoints and go from there. Regardless, it all works in containers.

Keep in mind that depending on your OS and docker setup, you can just have your container read files from your local filesystem. So edits are immediately reflected in your container and you don't need to build a new one when making changes. It is pretty flexible.

Re: Ask HN: Do you use a dev container and why?

#15

Docker is very convenient when it comes to maintaining uniformity across different developers machines. Once the boilerplate is done, 'docker compose' will stand up complex projects in a matter of minutes (depending in machine/internet speeds). Every startup that I have worked at uses docker and, honestly, I would question why one wouldn't want to use it. Most of my work has involved rails or golang. Live debugging o…

What do you mean live debugging isn't a thing? Delve integration into Goland makes setting breakpoints and analyzing variables great.

Of course it's nothing like Python where you can stop execution and start manipulating variables...

Re: Ask HN: Do you use a dev container and why?

#16

Docker is very convenient when it comes to maintaining uniformity across different developers machines. Once the boilerplate is done, 'docker compose' will stand up complex projects in a matter of minutes (depending in machine/internet speeds). Every startup that I have worked at uses docker and, honestly, I would question why one wouldn't want to use it. Most of my work has involved rails or golang. Live debugging o…

What do you mean live debugging isn't a thing? Delve integration into Goland makes setting breakpoints and analyzing variables great. Of course it's nothing like Python where you can stop execution and start manipulating variables...

Certainly delve exists and I'm sure it is fantastic, but it just isn't something I have ever needed to reach for when developing with go.
Post reply on HN