Skip to content

Minimal code on "real" disk #19

Description

@aug24

Currently, it's not trivial to start a project in a devcontainer without first downloading the entire repo. It would be better if there was a trivial way to do this, to avoid the temptation to simply clone / run a project and run the risk of a supply chain attack running with local (admin) privileges.

A minimal example bootstrap script for a project which already has devcontainer support in the repo is as follows (requires gh):

gh auth login
repo=<specify repo name here>
mkdir -p $repo
cd $repo

for filepath in .devcontainer/shared/devcontainer.json .devcontainer/devenv.yaml; do
  mkdir -p $(dirname $filepath);
  curl -H "Authorization: Bearer $(gh auth token)" -H 'Accept: application/vnd.github.v3.raw' "https://api.github.com/repos/guardian/$repo/contents/$filepath" > $filepath;
done

devenv generate
open -na 'Intellij idea' --args . --line 1 .devcontainer/user/devcontainer.json

In IntelliJ, click the cube in the gutter. Clone sources, providing a git ssh address for the repo

NB There is cli tooling from vscode that may be considered.

This is a short to medium term issue because we anticipate that the IDEs will develop this functionality.

See https://intellij-support.jetbrains.com/hc/en-us/requests/8576736

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions