Live data from Hacker News

VSCode, Dev Containers and Docker

blog.feabhas.com

61–70 of 234 posts

Re: VSCode, Dev Containers and Docker

#61
post #38
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.

To make it workable I had to just give up on the local host file integration. I basically used the container like a VM. Configured it with all the tools I normally use (e.g. OhMyZsh, etc) and had it constantly running in the background. I would use VS Code as a front end and work directly inside the container (cloning repos and pushing commits). It had its quirks but the main benefit was that my local machine was no…

What would be the advantage of this setup over a traditional VM where you presumably have more portability of the stateful image?

Re: VSCode, Dev Containers and Docker

#62

Slightly off-topic, it really irks me when people take about reproducible builds/environments while using docker, while having something along the lines of apt-get update/pip install in their dockerfile. Like that completely destroys the reproducibility of your container!

I never understood why commands like apt-get don't take a version with the dependency name.

Re: VSCode, Dev Containers and Docker

#63
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/

Anti-pattern 1 perfectly describes how I am (hamfistedly) using Docker. Thanks! However, it doesn't really explain how to fix my mindset. It just says that I should ;-)

Could you give me some hints?

Re: VSCode, Dev Containers and Docker

#64
post #43

Earlier quoted context omitted.

Have you tried docker on Windows? It's even worse. On OSX I only had problems with GUI running in docker. I was used to sharing X between linux host and docker container also running linux. For some projects, the only working solution I found was to run a VNC server in docker. Specific example: in a docker container, run a GUI built with Kivy and view the window on the OSX host. If anyone manages to do this without V…

> Have you tried docker on Windows? It's even worse. I've been running Docker on Windows since Windows 10 17.09 or roughly the time WSL 1 came around. That's since October 2017. It's been really fast and stable here and now with WSL 2 it's even better. There hasn't been a single Flask, Rails, Phoenix or Webpack related project I've developed in the last 3+ years where I felt like Docker was slowing me down[0]. I'm us…

Also been using Docker on Windows 10 since around the 2016/2017, and also had no issues with speed - it works marvellously!

Re: VSCode, Dev Containers and Docker

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

I use vscode to connect to a a cloud vm. VSCode is surprisingly good at this. Client is local and connects to an vscode server over ssh. Granted I work on Azure and the cost of the vm is not something I have to worry about.

I do this, but with a Linux VM running in Parallels on my Mac. Uses about 1/10 the CPU that Docker on Mac uses for the containers I run.

Re: VSCode, Dev Containers and Docker

#66

Earlier quoted context omitted.

Agreed, try running webpack in debug mode with watch it's basically not-usable, as is git and install npm packages.

npm / webpack: That's not Docker's fault - that's node/JS's fault. Having to touch thousands and thousands of files is expensive. This is why I've come to loath web frontend development.

> I've come to loath web frontend development.

Well, we don't have to do things this way just because everybody else does... developing "vanilla" Javascript is actually a pleasure especially with tools like Chrome's debugger. In my experience, front-end "frameworks" like Angular and React provide very little value and tons of unnecessary overhead.

Re: VSCode, Dev Containers and Docker

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

Re: VSCode, Dev Containers and Docker

#68

Slightly off-topic, it really irks me when people take about reproducible builds/environments while using docker, while having something along the lines of apt-get update/pip install in their dockerfile. Like that completely destroys the reproducibility of your container!

And by that you mean that the version of those deps aren't pinned?

You depend on what the repository serves for "apt-get". You may pin it, but it still doesn't guarantee you're going to get the same version if it was replaced on the repository without changing the version.

Re: VSCode, Dev Containers and Docker

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

Have you tried docker on Windows? It's even worse. On OSX I only had problems with GUI running in docker. I was used to sharing X between linux host and docker container also running linux. For some projects, the only working solution I found was to run a VNC server in docker. Specific example: in a docker container, run a GUI built with Kivy and view the window on the OSX host. If anyone manages to do this without V…

WLS2, docker desktop, running it for couple of years, so far so good

Re: VSCode, Dev Containers and Docker

#70

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

agreed. that docker is needed represents a failure of our industry
Post reply on HN