Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support installing devcontainer CLI independently of Remote-Containers #5415

Closed
stuartleeks opened this issue Aug 5, 2021 · 17 comments
Closed
Assignees
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality

Comments

@stuartleeks
Copy link

To support building dev container images in CI builds, publish the devcontainer CLI so that it can be installed and run independently of the Remote-Containers extension.

(This would be a step towards supporting this request)

@felipecrs
Copy link

This would be a very good feature for me, which have automated ways to setup the development environment of each of my team member. The devcontainer cli installation today is a pitfall, as it is fully manual.

Publishing as a npm package would be more than enough. :)

@sandy081 sandy081 assigned chrmarti and unassigned stuartleeks Oct 1, 2021
@sandy081 sandy081 modified the milestones: September 2021, October 2021 Oct 1, 2021
@chrmarti chrmarti added feature-request Request for new features or functionality and removed plan-item A plan item labels Oct 1, 2021
@chrmarti chrmarti modified the milestones: October 2021, September 2021 Oct 1, 2021
@chrmarti
Copy link
Contributor

chrmarti commented Oct 1, 2021

Available at https://github.com/microsoft/vscode-remote-release/packages/1019896.

@chrmarti chrmarti closed this as completed Oct 1, 2021
@felipecrs
Copy link

felipecrs commented Oct 1, 2021

@chrmarti wow, this is very cool. But is there any major reason why not to publish it to npm.js instead? Many other vscode-related packages from Microsoft are being published there, and not being on NPM adds a burden to the installation process, as we have to set the repository and so.

@felipecrs
Copy link

Not only the standalone installation but also when other people would like to add this package to their devDependencies in package.json.

@felipecrs
Copy link

Also, if you actually publish to npm.js, I would suggest you to name the package as devcontainer only, so that npx devcontainer build would work out-of-the-box. Otherwise, if the package was named devcontainer-cli, it would need to be called as npx -p devcontainer-cli devcontainer build.

@chrmarti
Copy link
Contributor

chrmarti commented Oct 4, 2021

@felipecrs We are not sure how the community would feel about a non-OSS package on npmjs.org, so we decided to start with publishing it to the GitHub registry.

On naming: We have started using the @vscode scope, so it might be npx @vscode/dev-container. If you install the package, the executable is just devcontainer (or devcontainer-insiders when part of the extension in VS Code Insiders).

@chrmarti chrmarti added the verification-needed Verification of issue is requested label Oct 4, 2021
@chrmarti
Copy link
Contributor

chrmarti commented Oct 4, 2021

For the verifier: Check that you can install the package and run the CLI.

npm login --registry=https://npm.pkg.github.com
npm config set @microsoft:registry https://npm.pkg.github.com
npm install @microsoft/dev-container-cli
npx @microsoft/dev-container-cli

@felipecrs
Copy link

Well, having to login prior the download makes the things... a lot more complicated. Having to generate and inject the token in our CI pipelines, or having to add a manual step during the development environment setup (aka dotfiles) for logging into the Github's NPM registry is definitely a show-stopper for us (us -> my team).

This is even worse considering that the package is freely distributed, so it's not about having access to it or not, as any GitHub account would have.

The npm.js accepts closed source packages just fine, you just have to make sure to mention the license in the package.json correctly.

Regarding how the community would react to it, perhaps we can do a voting-like thing? I see no reason why would someone complain -- of course anyone in the community would prefer that it was open source, but that has zero relationship with publishing it to npm.js.

@stuartleeks
Copy link
Author

Also, if you actually publish to npm.js, I would suggest you to name the package as devcontainer only, so that npx devcontainer build would work out-of-the-box. Otherwise, if the package was named devcontainer-cli, it would need to be called as npx -p devcontainer-cli devcontainer build.

The package.json for the CLI has the bin property set so that the command is set as devcontainer even though the package is dev-container-cli

@felipecrs
Copy link

The package.json for the CLI has the bin property set so that the command is set as devcontainer even though the package is dev-container-cli

You are absolutely right. Sorry for my confusion.

It means that the package could even be submitted as something like @vscode-remote/devcontainer-cli or @vscode-non-oss/devcontainer-cli to npm.js to make it even more clear that they are not like the other vscode packages, which are OSS.

@chrmarti chrmarti removed this from the September 2021 milestone Oct 6, 2021
@chrmarti chrmarti reopened this Oct 6, 2021
@chrmarti chrmarti removed the verification-needed Verification of issue is requested label Oct 6, 2021
@chrmarti
Copy link
Contributor

chrmarti commented Oct 6, 2021

We have removed the package, looking into alternatives.

@felipecrs
Copy link

Is there any news?

@chrmarti
Copy link
Contributor

Sorry, forgot to post an update: This is available on npmjs.com as https://www.npmjs.com/package/@vscode/dev-container-cli.

@chrmarti chrmarti added this to the September 2021 milestone Nov 18, 2021
@felipecrs
Copy link

Amazing. Thanks a lot!

@felipecrs
Copy link

@chrmarti this package is missing the open command:

image

@chrmarti
Copy link
Contributor

@felipecrs We don't have that (yet) because the association between the NPM package with one of your VS Code installations is less obvious (there could be several, e.g., stable and insiders). If this is of interest, could you file a feature request? Thanks!

@felipecrs
Copy link

I just did it. Thank you.

#5957

@github-actions github-actions bot locked and limited conversation to collaborators Jan 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants