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

postCreateCommand cannot find executables that should be in PATH #1234

Open
eguiraud opened this issue Aug 27, 2024 · 1 comment
Open

postCreateCommand cannot find executables that should be in PATH #1234

eguiraud opened this issue Aug 27, 2024 · 1 comment
Labels

Comments

@eguiraud
Copy link

eguiraud commented Aug 27, 2024

What happened?
In a dev container that uses the pre-commit dev container feature to install pre-commit, I have a "postCreateCommand": "pre-commit install". It fails to run:

16:26:53 info Run command : pre-commit install...
16:26:53 warn bash: line 1: pre-commit: command not found
16:26:53 info lifecycle hooks: failed to run: pre-commit install, error: exit status 127
16:26:53 info devcontainer up: run agent command: Process exited with status 1
16:26:53 error Try using the --debug flag to see a more verbose output
16:26:53 fatal run agent command: Process exited with status 1

What did you expect to happen instead?

pre-commit should be in PATH in the dev container context: it is installed by the feature.

How can we reproduce the bug? (as minimally and precisely as possible)

This repo reproduces the issue with devpod up . --recreate:

https://github.com/eguiraud/devpod-postcreatecommand-issue

The devcontiner.json:

{
  "build": {
    "dockerfile": "Dockerfile",
    "context": ".."
  },
  "remoteEnv": {
    // set variable to the local user
    // Needed to upload to the db as the correct user
    "OS_USER": "${localEnv:USER}"
  },
  "features": {
    "ghcr.io/prulloac/devcontainer-features/pre-commit:1": {},
  },
  "remoteUser": "devuser",

  // install pre-commit Git hooks automatically after build
  "postCreateCommand": "pre-commit install",
}

Local Environment:

  • DevPod Version: v0.5.19
  • Operating System: linux
  • ARCH of the OS: AMD64

DevPod Provider:

  • Local/remote provider: docker | ssh

Anything else we need to know?

Works with VSCode.

Related (closed) issue: #1084

@pascalbreuninger
Copy link
Member

Hi @eguiraud, thanks for reporting this issue. We'll look into it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants