Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/contracts/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface Feature {
licenseURL?: string;
options?: Record<string, IOption>;
containerEnv?: Record<string, string>;
mounts?: Mount[];
mounts?: (Mount|string)[];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that this is currently allowed by the CLI, however, this is an old syntax that shouldn't be used anymore. (This might be deprecated soon)

https://github.com/devcontainers/cli/blob/2a6ab1ac82f4917654205e2a9b1ac928260d902e/.devcontainer/devcontainer.json#L15 definitely needs to updated to use the new syntax 🤦‍♀️

We don't mention supporting string for mounts in https://containers.dev/implementors/features/ and https://containers.dev/implementors/json_schema/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that https://containers.dev/implementors/json_schema/ does not synced with the schema.json https://github.com/devcontainers/spec/blob/87e7ce0a2e25264032e836a3c5379692491e9d4b/schemas/devContainer.base.schema.json#L236-L246

And you're right, the feature's schema is defined as Mount[] only.

So how about consider this as spec issues:

  1. No differences of mounts's type between template and feature
  2. I also believe mounts with strict type is a good thing, but currently it only support type, source and target, and docker bind mounts have more options, would it be better to define them all? For example, readonly is really useful: https://github.com/search?q=path%3Adevcontainer.json+%2F%22%5B%5E%22%5D*type%3D%28bind%7Cvolume%29%5B%5E%22%5D*readonly%5B%5E%22%5D*%22%2F&type=code

Copy link
Member

@samruddhikhandale samruddhikhandale Feb 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sharing your thoughts!

So how about consider this as spec issues:

Makes sense to me 👍

init?: boolean;
privileged?: boolean;
capAdd?: string[];
Expand Down