3 ms·
I work in a Windows centric industry and devcontainers were a complete game changer for our productivity. One click and you have a newcomer's development enviro
by pid-1 3y ago
I work in a Windows centric industry and devcontainers were a complete game changer for our productivity. One click and you have a newcomer's development environment ready, locally. Gone are days I had to teach folks how to install PostGIS, or help them because their version of libfoo was wrong.
When we started, in 2020, there were many rough edges both in the extension and WSL2, but the experience got remarkably better over time.
- _joel 3y agoWhy would devcontainers give you anything better over just a plain old Dockerfile, for your usage?
- stevefan1999 3y agoYou have automatic tooling configurations and a consistent developement environment that you can expect to run anywhere. Basically Microsoft Intune done right for programmers. If you think about it Nix Flakes shares the same philosophy. But flakes, as from my experience a year and a half ago, are ergonomics-wise terrible.
- markphip 3y agoI see it as being similar to the relationship between Vagrant and Virtual Machines. You can use plain Dockerfiles if you prefer, dev containers provides some tooling to smooth out the rough edges of using Docker to host your dev environment including mounting your source code into the container etc. Details are at: https://containers.dev https://containers.dev
- qbasic_forever 3y agoIt's integrated into vs code and nearly transparent. Like they said, someone new to a project can just open the IDE and their environment is automatically setup vs. spending days installing tools from a (likely) undocumented and out of date process.
- jabradoodle 3y agoYou haven't answered the question, it doesn't take days if you use a standard dockerfile, and it can be used by team members who don't use vscode.
- qbasic_forever 3y agoYou don't understand the feature. Devcontainers can use any plain old dockerfile or docker compose file, it's literally part of the spec. You can do exactly what you're saying--have a dockerfile as the source of truth--right now. And you can install the devcontainer CLI and use it outside vs code if necessary too: https://code.visualstudio.com/docs/devcontainers/devcontainer-cli https://code.visualstudio.com/docs/devcontainers/devcontaine...
- axlee 3y agoWhat are devcontainers bringing more than what "docker-compose up" already does, if your app is already compose-ready for local?
- qbasic_forever 3y agoAgain, it's integrated in vs code and GitHub codespaces. If you open your project in vs code it detects the devcontainer config and automatically launches the container using docker, connects vs code remotely to code in the container, and pops open any terminals or tool executions in the container. On GitHub codespaces it gives you a button on the website that is literally one click and get vs code in the browser connected to your dev container launched in their cloud--you don't even need vs code or anything installed and can code from a tablet for example.
- deleted 3y ago[deleted]
- jabradoodle 3y agoI didn't realize there was an open source cli, true. However > vs. spending days installing tools from a (likely) undocumented and out of date process This makes no sense, that is not an advantage over a dockerfile.
- pid-1 3y agoWe started with plain Docker Compose files (one container for our project, others for DB, Spark, Airflow, etc.). For more experienced, full-time developers this setup was good enough (though it required a few extra steps after `docker compose up`). But it still showed significant friction for (a) very junior developers (b) non technical business people who wanted to code. Generally the same folks that would need help installing PostGIS on their machines, etc. People just wanted to merge some cool ideas into our codebases and now they needed to learn wtf Docker and Docker Compose are[1]. That was a huge time waster. Devcontainers are neatly integrated into VS Code's UI, so they solved the "last mile" problem of allowing non-tech folks to use containers. [1] https://www.youtube.com/watch?v=AbSehcT19u0&themeRefresh=1 https://www.youtube.com/watch?v=AbSehcT19u0&themeRefresh=1
- nsonha 3y agohave you even looked into devcontainers? If people build a docker wrapper just to give you the exact things docker can do, that would be ridiculous wouldn't it? A cursory view of the devcontainer website will reveal that vscode is mentioned a bunch of times
- jabradoodle 3y agoHave you read the comment op was replying to?
- nsonha 3y agothe reply implies that they were using vscode, I guess op was telling them to stop doing that because?
- _joel 3y agoI never suggested such a thing, I wanted to know why it's better than just Dockerfiles and it seems vscode integration. Everything else can be achieved with docker, compose and/or makefiles.
- andrewmutz 3y agoI use these every day and here's some things I like: * You can add a docker compose file as well as a docker file. This means that all of the services you want to exist (postgres, redis, etc) don't have to be separately installed/updated by each developer on the team. * Good vscode integration. It doesn't feel like you're developing inside a container. You open a terminal, and its inside your containerized dev environment. * "Features" (https://containers.dev/implementors/features/ https://containers.dev/implementors/features/ ) which allow you to quickly add functionality to your dev containers. For example, when I want to add the terraform CLI, I add the corresponding feature to the devcontainer.json. * At the end of the day it's all built on docker, docker-compose, etc so there is minimal lock-in to vscode