devcontainers / cli

A reference implementation for the specification that can create and configure a dev container from a devcontainer.json.
https://containers.dev
MIT License
1.4k stars 195 forks source link

Request: subcommand to download and unpack feature #697

Closed jeffb4 closed 7 months ago

jeffb4 commented 7 months ago

Problem: There is currently no purpose-built tool to download and unpack application/vnd.devcontainers .

What I'm trying to do: I am trying to create a build for something-like a devcontainer without requiring a @devcontainers/cli npm installation on the building host. So, within a build context I would like a utility to download and unpack features.

Example: devconatiner features fetch ghcr.io/devcontainers/features/docker-in-docker:2 /tmp/dind would download the tarball for ghcr.io/devcontainers/features/docker-in-docker:2 and unpack to /tmp/dind. Optionally dependencies could be downloaded as well.

joshspicer commented 7 months ago

There's been some discussion on a similar vendor command for a different purpose https://github.com/devcontainers/cli/issues/399

I believe this is something everyone is open to, although our team hasn't had the capacity to implement. We'd be open to reviewing a PR if you're interested in providing the implementation. I think the signature you've provided above is reasonable 👍

joshspicer commented 7 months ago

Note that you may be able to leverage the oras CLI (similar to how it's spelled out in the spec here) to achieve your goal

jeffb4 commented 7 months ago

@joshspicer oras works perfectly (I tried skopeo and umoci without much success), thanks a ton.

Closing, since it works so well.