devcontainers / images

Repository for pre-built dev container images published under mcr.microsoft.com/devcontainers
https://containers.dev
MIT License
1.32k stars 490 forks source link

Include Homebrew in universal image #903

Open texastoland opened 10 months ago

texastoland commented 10 months ago

I imagine there's a reason this wasn't done already. I thought it's worth opening an issue for others searching too. My use case is replicating my Mac config in Codespaces. I want a few CLIs available everywhere like lazygit. It can be installed with conda-forge but that isn't true for everything. Default Apt sources simply don't include many modern utilities.

Related: microsoft/vscode-dev-containers#357

eljog commented 10 months ago

As discussed on the issue you linked here https://github.com/microsoft/vscode-dev-containers/issues/357#issuecomment-696132886 the growing size of the universal image is one thing that holds us conservative when adding new packages.

Have you considered installing Homebrew as a feature inside your devcontainers json. Looks like there are community provided devcontainer-features available for Homebrew. See https://containers.dev/features

texastoland commented 10 months ago

My use case (and the general use case for Codespaces) is reproducing my dev environment from dotfiles in every image (using brew bundle).

Considerations

  1. No other package manager on the image hosts popular modern utilities (Nushell for example) nor (especially) cross-platform
  2. https://github.com/microsoft/vscode-dev-containers/issues/357#issuecomment-696096859 mentions a "lite" installation which has since become the default by replacing shallow cloning with GitHub API calls (even less disk space)
  3. brew could be a shell function that installs on first use (exactly how Homebrew subcommands work)