feature-install-script-not-executable

disallow a Feature’s install.sh that lacks executable permission bits

Category
correctness
Applies to
feature
Platforms
all

Why

The specification has the installing tool invoke “install.sh” directly rather than through a shell, so that the script’s own shebang selects the interpreter. That requires the execute bit: without it the Feature fails to install when a container is built. Run “chmod +x install.sh” and commit the mode change.

Bad

devcontainer-feature.json

{
  "id": "node",
  "version": "1.0.0",
  "name": "Node.js"
}

install.sh (mode 0644)

#!/usr/bin/env bash
set -e
apt-get update && apt-get install -y nodejs

Good

devcontainer-feature.json

{
  "id": "node",
  "version": "1.0.0",
  "name": "Node.js"
}

install.sh (mode 0755)

#!/usr/bin/env bash
set -e
apt-get update && apt-get install -y nodejs

Git records the executable bit, so committing the mode change is what makes the fix stick. On Windows, where the filesystem has no executable bit, set it in the index directly: git update-index --chmod=+x install.sh.

References