microsoft / vscode-dev-containers

NOTE: Most of the contents of this repository have been migrated to the new devcontainers GitHub org (https://github.com/devcontainers). See https://github.com/devcontainers/template-starter and https://github.com/devcontainers/feature-starter for information on creating your own!
https://aka.ms/vscode-remote
MIT License
4.71k stars 1.4k forks source link

Provide Fedora based devcontainer #1292

Open mwisnicki opened 2 years ago

mwisnicki commented 2 years ago

Please provide alternative devcontainer based on Fedora. Sometimes developing on Ubuntu is not an option.

Relates to: <Codespaces | Remote - Containers | Both>

eitsupi commented 2 years ago

I think you may build it yourself by using common-redhat.sh. https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/common.md

mwisnicki commented 2 years ago

Thanks for pointing me to that script. I did it by hand without knowing about it. Would be nice if this was more documented and official image would be even better.

Chuxel commented 2 years ago

Given the nuances involved, we've optimized for the debian/ubuntu distro tree for our pre-built images and samples. We do not currently have plans to expand outside of this, but it would be interesting to hear about the scenarios you are thinking about where developing on Debian/Ubuntu is not an option. Do you have an example?

To be clear, the extension itself is not limited to only these distributions at all, however, and we are looking into how we can enable the community more easily share definitions and features like those in this repository (as mentioned in https://github.com/microsoft/vscode-dev-containers/issues/1291). We want to make it easier for everyone to collaborate than is possible with this repository alone - partly because there's little doubt that different communities have different preferences on Linux distributions.

mwisnicki commented 2 years ago

I had to work on a project that only provided instructions how to setup Fedora/RH development environment and some of the dev dependencies were not even packaged in Debian/Ubuntu. Sticking with Fedora in this case was massively easier than trying to figure out how to build all the missing stuff.

mwisnicki commented 2 years ago

And this is exactly the use case I consider to be the strong point of CodeSpaces - it doesn't matter which distro or even platform I personally use (which would be Windows 11🙂) because I can quickly get any environment tailored to specific needs of the project at hand.

Chuxel commented 2 years ago

@mwisnicki Yep agreed. You can encapsulate those setup instructions in a Dockerfile like you are saying. Given those instructions existed, was it the common script that you were looking for?

mwisnicki commented 2 years ago

I looked for any kind of instructions. It wasn't even clear from documentation whether you can use any non-codespaces aware base image (turns out you can just base it on fedora:latest and things just work even without common script).

I used google(github codespaces fedora) and google(github codespaces base image) and didn't find anything on the first pages of results. Now it's finding this ticket so should be easier :)

I think it would be useful to update https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/configuring-codespaces-for-your-project#dockerfile to mention you can use any base image, not necessarily from mcr.microsoft.com/vscode/devcontainers/*.

I'm sure one could follow all the links in documentation and find this information somewhere after reading dozens of pages of text but there's just way too much of it.

Of course ideal experience is not having to reach out to documentation/google at all and just have it offered by codespaces UI before creating environment, like you offer Alpine.

Chuxel commented 2 years ago

@bamurtaugh (and @2percentsilk @nikmd23 for related Codespaces docs) This is good feedback re docs 👆

We definitely don't want to leave the impression that you have to use our images - they're there as a convenience for when you don't have one already you want to build up from.

That said, for a base image, makes sense. Flipping to a feature request for that bit.

bamurtaugh commented 2 years ago

This is great feedback, thanks @mwisnicki!

Reviewing docs on the VS Code side, it looks like we mention You can use any image, Dockerfile, or set of Docker Compose files as a starting point. Here is a simple example that uses one of the pre-built [VS Code Development Container images](https://hub.docker.com/_/microsoft-vscode-devcontainers):, which seems to help with this feedback (please let me know if it could be clearer!).

@2percentsilk maybe in the Codespaces doc, we could add something similar? i.e. amend the text to:

You can add a Dockerfile to your project to define a container image and install software. In the Dockerfile, you can use FROM to specify the container image, which may be hosted in any registry.

mwisnicki commented 2 years ago

Yes that's pretty useful but does not come up when google search terms include "github" :( I'm pretty spoiled by usually finding answer to my questions within first few results and often with excerpt highlighted by google :)

froazin commented 1 year ago

+1 would be very helpful for working on projects targeting rhel, just for the sake of having easy access to tools like rpmbuild. Currently my work around is to the docker in docker template, then use a Makefile and Dockerfile to pull a fedora image and build the project in there - Not the end of the world, but certainly a quality of life improvement to work natively within the RedHat echo system in cases like this