5 ms·
Microsoft Docker Development Container Templates
- Alifatisk 3y agoOoo, they have one for rails + postgres! https://github.com/devcontainers/templates/tree/main/src/ruby-rails-postgres https://github.com/devcontainers/templates/tree/main/src/rub...
- bdcravens 3y agoThat Dockerfile looks extremely bare.
- Alifatisk 3y agoDo you have any better examples? I really want to get started with devcontainers for when collaborating with other devs using other platforms.
- bdcravens 3y agoOf a devcontainer, or a Rails app Dockerfile? I've built many Rails apps in Docker, and there's a lot you have to add. To utilize devcontainers, I feel like it would need to include a lot of the boilerplate that is missing here. You could roll your own, but I think that would strongly impair devcontainer adoption industrywide.
- Alifatisk 3y agoOf a devcontainer
- markphip 3y agoThese are just starter templates, they are supposed to be bare. If you think there are some other standard things that ought to be included I am sure they would appreciate the Issue or PR.
- bdcravens 3y agoOf course, but even a bare Rails Dockerfile would include much more than this, and pretty much every Rails app built off of this would be including much of the same boilerplate.
- pid-1 3y agoI 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 ago
- Apreche 3y agoDevcontainers have saved me so much time setting up new dev environments. I highly recommend.
- cogman10 3y agoAlternatively, check out tilt. (Especially if you are doing k8s). It'll start up everything for regular dev, supports live reload, and will put in proper waits while your environment gets into a ready state.
- throwanem 3y agoThis appears to be a Docker Compose templating scheme for Github Codespaces. Is there a USP beyond that?
- markphip 3y agoSee: https://containers.dev https://containers.dev Codespaces is where I use them but it is supported by VS Code and can be used locally or in other scenarios as well. It mainly improves DX over using bare Docker for running your developer inner loop. Yes you can do this yourself using Docker and docker-compose if that is your preference.
- smcleod 3y agoI’m not across the Microsoft ecosystem but why is it (that people say) it’s so difficult for people to setup their dev environments? Is it something to do with running windows or is it a .net thing?
- markphip 3y agoThis is about containers .. so primarily about running a Linux dev environment in a container. https://containers.dev https://containers.dev I would guess the Microsoft angle here is to make the process smooth for a developer running VS Code in Windows to develop in a Linux container from Windows. I personally use it in Codespaces, so there is also the cloud developer environment aspect of it. Nothing about this is Microsoft or Windows-specific.
- smcleod 3y agoBut surely if your code base is that difficult to setup your dev environment for - it’s likely a sign of much bigger problems? The reason I asked about windows was because a few folks here said it is helping them with their windows dev environments, where as in my experience with software you’re developing for *Nix it’s not really a big deal. Usually you’re just checking out the repo(s) and running your languages command to install the libs.
- markphip 3y ago> But surely if your code base is that difficult to setup your dev environment for - it’s likely a sign of much bigger problems? I think it less about difficulty and more about when you have a desire to run your dev environment in a container. How are you getting your source code into the container? How is your editor accessing the source code to make changes etc. Dev Containers provides a pattern to follow for doing this that works across tools and OS that can simplify it for your team. If you work on a large team where devs work on the OS and Editor of their choice it can also simplify the development docs and environments you need to maintain. You can develop things like Node, Python, Ruby natively on Windows but if you are deploying on Linux, especially if in a container on Linux, having the dev environment running in Docker has advantages and there is less for the developer to setup and maintain.
- johnchristopher 3y agoI don't understand, I am not getting an "aha!" moment. I checked php and didn't see much, I didn't see xdebug for instance. What am I missing ?
- markphip 3y agoI do not know why someone shared this repo, there is nothing special about it other than containing some start templates. I would start here for understanding Dev Containers: https://containers.dev https://containers.dev If you have a scenario where using a container as your development environment makes sense, this is some tooling that can improve the developer experience vs just using plain Docker and Docker Compose.
- politelemon 3y agoIs it possible to debug code inside a 'devcontainer' environment? Does devcontainers actually run VSCode as a server in the container?
- markphip 3y agoYes to both questions. This is essentially how Codespaces works too, fwiw.
- johnchristopher 3y agoI usually put my code into a volume and use bindfs to read/write that volume from the host as a regular user (with vscode, vim, whatever). It prevents ownership conflicts since files in the volumes are owned by root/www-data/whoever. VScode can be configured with a mapping between running code in the container and accessible code in the host so xdebug breakpoints are set on the host in vscode and when xdebug calls back vscode it gets xdebug data and displays it on the host. Would codespace solve that more elegantly ?
- pc86 3y agoI don't know what "run VSCode as a server" is supposed to mean in this context, but there are other comments in this page that suggest the integration between dev containers and vscode is pretty good, e.g. opening a terminal is just scoped to that container by default, etc.
- pamelafox 3y agoDisclosure : MS employee I love dev containers and do all my work in them. I often start from the above images and then add more, like adding postgres in the container. If you are looking for examples, nearly all the repos linked from https://github.com/pamelafox https://github.com/pamelafox have dev containers. Mostly for Python backed web apps.
- jabradoodle 3y agoCan't believe people rely on solutions tied to a single editor. Do you really have nobody on your team who doesn't use vscode.
- arnley 3y agoIt is not tied to VS Code.
- qbasic_forever 3y agoIt's not tied to vs code, you can install a standalone CLI if you need to exactly replicate the container somewhere else (wherever node and docker can be installed): https://code.visualstudio.com/docs/devcontainers/devcontainer-cli https://code.visualstudio.com/docs/devcontainers/devcontaine... But... I don't think you have a good understanding of the feature if you're making that comment. Most people that use dev containers just have a dockerfile or docker compose file in their project and point the dev container config at it directly. Anything can use that dockerfile, it's not special in any way.
- markphip 3y agoA list of supporting tools and services is listed on the web site: https://containers.dev/supporting https://containers.dev/supporting
- cies 3y agoIf you (MSFT) cannot beat them (Linux), join them.
- cies 3y agoSame also with their web browser. Isn't their new browser based on Chrome (which in turn was based on KDE's KHTML library)?
- deleted 3y ago[deleted]
- jaxn 3y agoI love devcontainers, I just wish performance was better on Apple M* chips. Granted, it’s not really a problem with devcontainers as much as it is with docker mounts. But that makes devcontainers terribly slow when the code is on the local file system and mounted into the devcontainer, which is the default.
- adr1an 3y ago(deleted)
- jbverschoor 3y agoWorks great in combination with orbstack
- gigel82 3y agoWhen will we see some usable containers for Windows from Microsoft? You can't use Nano or Core for building C++ code with Visual Studio / MSBuild, so you're bringing down the whole Windows container (3.4Gb compressed) which is effectively as heavy as a full VM.