Live data from Hacker News

VSCode, Dev Containers and Docker

blog.feabhas.com

221–230 of 234 posts

Re: VSCode, Dev Containers and Docker

#221
post #96

Earlier quoted context omitted.

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.

Re: VSCode, Dev Containers and Docker

#222

Earlier quoted context omitted.

rbenv actually solves this quite well. You can set a project-level version in a .ruby-version file, and each lang version has its own gem cache

Yeah. I have over a dozen Ruby on Rails apps on my development machine, targeting a variety of Ruby and RoR (and other common gem) versions. I'm not aware of any problems anyone has experienced in recent years, since everyone has moved to rbenv. We used to see issues with rvm. I don't use docker with any of these projects. They're mostly legacy for us at this point and are shipping to EC2 instances directly. Our more…

I used to work at a company where I'd write and maintain multiple microservices, so I was dealing with dozens of small and big ruby applications across different language versions and different frameworks and dependencies. It was two years ago, but I did experience a ton of issues between different versions of Bundler and rake and rubygems. I'd absolutely go full docker if I was still working there.

Re: VSCode, Dev Containers and Docker

#223

Earlier quoted context omitted.

for python, why cant you use use virtualenv with pyenv?

Because it is a Python specific thing. Docker works with all programming languages and that's it. If you are full stack or work with multiple programming languages there is no need to learn the "equivalent" of virtualenv everywhere else. Also with docker there is no setup/installation involved. You just pull the image and that is it. Also virtualenv requires that you already have pip/python installed. Docker requires…

Second this. Developing in Docker completely liberated me from the caprice of Python packaging and Node dependency management and made doing development work on multiple platforms (MacOS, Ubuntu) frictionless.

There’s a “pets vs cattle” angle here, too. Something goes wrong, just pave over it and start again.

YMMV, of course, but I can’t imagine going back.

Re: VSCode, Dev Containers and Docker

#224

As amazing and convenient as Docker is in practice, containers hide the inherent mess that is modern computing, and the more they are used, the less chance is that this mess is getting cleaned up... ever. Ultimately this is another dependency, complexity hidden by another layer...

Understand that people quite reasonably feel this way but I personally don’t.

You’ve got to pick your battles. If you’re, for example, a front-end dev working right up at the top of the stack, then delivering value to your clients means getting them their marketing webpage, CRUD app, what-have-you. To do that you have to abstract away a vertiginous amount of stuff under you, all the way down the stack. We’re all standing on the shoulders of giants.

Docker is an amazing tool for just this sort of thing.

Re: VSCode, Dev Containers and Docker

#225
post #151

Earlier quoted context omitted.

I don't think so. If fact you could just package your "CLI driven workflow" up into a docker image and now you can instantly move it between machines, peers, etc... Furthermore you could version and manage the evolution/drift of your workflow as underlying components change/get updated.

Exactly: I have CI produce a Docker image from my dotfiles repo https://bergie.iki.fi/blog/docker-developer-shell/

[deleted]

Re: VSCode, Dev Containers and Docker

#227

One slight problem I had with .devcontainer in VS Code was running the devcontainer on a remote ssh server. Remote SSH works. Local devcontainer works. But mixing the two requires configuring the docker engine settings to point to the remote. This forces other projects to also run on the remote machine. This was a problem as of 2 months ago.

Is it not possible to set the Docker host to the remote machine under your project workspace settings only, instead of in global settings?

Re: VSCode, Dev Containers and Docker

#228
post #34

A little bit off-topic, but I hope it's relevant enough: can someone who's well-versed in Docker give me some pointers as to how I can use it in a better way? Let me elaborate. I'm a bit of an old fart when it comes to software development. I prefer stable, slowly evolving solutions. I am a fan of the role of classical distributions. I abhor bundling every piece of software with all its particular versioned dependenc…

You are confusing two different things. One is using Docker as a deployment packaging method. The other is using Docker only for development and still deploying traditionally. Sure you can do both, but it doesn't have to be this way. >when I use Docker, I pretend it's a VM Also check anti-patterns 1 and 4 here https://codefresh.io/containers/docker-anti-patterns/

This is an important distinction and one that sometimes gets lost in the back-and-forth over Docker.

I feel like a lot of the complaints levelled at Docker pertain to the packaging and deployment use case. Where Docker really shines - even for small teams or solo devs - is as a development tool.

Re: VSCode, Dev Containers and Docker

#229
post #210

Earlier quoted context omitted.

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.

Yeah, unfortunately the JetBrains IDEs don't really work with this workflow yet. I'm hoping one day they will ...

I saw online tutorials showing you how to set it up and wasted a few hours not managing to make it work.

Re: VSCode, Dev Containers and Docker

#230

Earlier quoted context omitted.

Unless, unimaginably, you need to keep your code on-prem... I know, I know. Unthinkable.

I haven't tested, but I think gitpod works with on-prem installations.

Yes, Gitpod is open-source and can be self-hosted: https://github.com/gitpod-io/gitpod/
Post reply on HN