Live data from Hacker News

VSCode, Dev Containers and Docker

blog.feabhas.com

201–210 of 234 posts

Re: VSCode, Dev Containers and Docker

#201
post #48
post #8

Doing any sort of development with Docker on OSX can be painfully slow if you have a lot of files that change frequently. There are a few projects to improve it but they quite aren't there yet. It's my least favourite aspect of modern web work.

the solution to this is to enable NFS for your volumes. The default volume configuration is a huge bottleneck for docker on macos

Although be aware, if you add shares to nfs.conf, your Mac will no longer sleep while connected to power, even if you close the lid.

Not sure if there's a way around it, but I was sitting down at my desk every morning to find a toasty laptop, lid closed and fans blaring.

Re: VSCode, Dev Containers and Docker

#202

Earlier quoted context omitted.

> 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?

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 dependen…

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.

Re: VSCode, Dev Containers and Docker

#203

Earlier quoted context omitted.

> 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?

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.

Re: VSCode, Dev Containers and Docker

#204
post #96

Earlier quoted context omitted.

> 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 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.

Re: VSCode, Dev Containers and Docker

#205

Earlier quoted context omitted.

That`s how we do it in my company: - Clone project - Build container - Develop If you're in a polyglot shop there are HUGE productivity gains in not needing to setup your environment manually, or worse, risk that vital information about it is distributed as tribal knowledge. Plus, if your project has external dependencies like DBs, S3, etc... you can use docker-compose with VS Code as well.

Can only second this, we use a VSCode devContainer-based setup in all of our projects and even migrate our legacy projects to it (software agency). Here's our current base go template, you only need Docker+VSCode on your system to get started: https://github.com/allaboutapps/go-starter Bonus points: * As all IDE operations solely run within the local Docker container, all developers can expect that their IDE will wor…

Does that force everyone to use VS Code only? Can non VS Code developers also work efficiently?

Re: VSCode, Dev Containers and Docker

#206
post #191

Earlier quoted context omitted.

> Is not docker server running inside a VM though No, docker server runs directly on top of the OS as a native program. As for Docker containers managed by the Docker server, they are runing on top of a supervisor - not in a full VM.

On Windows Docker runs in a VM.

That's wrong:

"With the latest version of Windows 10 (or 10 Server) and the beta of Docker for Windows, there's native Linux Container support on Windows. That means there's no Virtual Machine or Hyper-V involved (unless you want), so Linux Containers run on Windows itself using Windows 10's built in container support".

In any case, as Linux and macOS prove, there's no need for docker to have to run on a VM. And it seems there's no need on Windows either since 10.

Re: VSCode, Dev Containers and Docker

#207

Earlier quoted context omitted.

We also use remote dev boxes, but can VSCode connect to a remote server and connect to remote docker containers? For example, I don't have ruby installed on the remote dev box, but it is installed inside docker on the remote host. I also don't have ruby or docker running locally. I think all the linting plugins either expect ruby to be available on the remote host, or inside docker, but not this combo... Is there som…

Yes. Vscode (server) is running on the remote machine. Extensions run on the remote as well. A new terminal in vscode is a terminal on the remote. Only the client GUI is local.

Thank you. I managed to get it working... still I'm not sure about things like ruby-rubocop ... I can install it remotely, but not inside a remote docker container (where my ruby runs)... Any tips?

Re: VSCode, Dev Containers and Docker

#208
post #29

Earlier quoted context omitted.

I wrote this article a while back that compares setting up a Python development environment for web development with and without Docker: https://nickjanetakis.com/blog/setting-up-a-python-developme... The TL;DR is there's a lot of things to set up yourself without Docker in order to run a typical web application and it's different depending on what OS / version you use. Some of these things are unrelated to Python to…

A couple of years ago I got your Docker course and I learned a lot from it, been doing Docker chores for my teams ever since. Anyway, good course!

Thanks a lot!

Re: VSCode, Dev Containers and Docker

#209

Earlier quoted context omitted.

Can only second this, we use a VSCode devContainer-based setup in all of our projects and even migrate our legacy projects to it (software agency). Here's our current base go template, you only need Docker+VSCode on your system to get started: https://github.com/allaboutapps/go-starter Bonus points: * As all IDE operations solely run within the local Docker container, all developers can expect that their IDE will wor…

Does that force everyone to use VS Code only? Can non VS Code developers also work efficiently?

You could always run something like Vim/Neovim directly in the container.

I, personally, hope that JetBrains comes up with something similar which will allow devs to use the same workflow with the JetBrains IDEs.

Re: VSCode, Dev Containers and Docker

#210

Does this deprecate my vim/gcc/gdb/make (in general "CLI driven workflow") which I have assigned so much time to, to have a nice vender/IDE-independent solution for development? I'm curious to know the answer in an honest/practically-speaking sense not ideologically. IMO, the downside of this container/web-app solution is the memory size that all the SDKs would need and this would add up eventually. But I'm not sure…

It actually makes your workflow more powerful as you can package it in a container and other devs can start using it in no time.

I have never managed to get a step through debugger working with Pycharm. I know it's possible, but things like this are why devs won't be able to "start using it in no time". Docker solves one set of problems and introduces others.
Post reply on HN