devcontainers / devcontainers/templates

postCreateCommand Permission denied

Open
#247 2 comments 1 reaction 0 assignees View on GitHub
info-needed
Dominant language
Shell
Stars
1.4k
Forks
393
Avg merge
2h 3m
Merged PRs (30d)
1

Description

```
Running the postCreateCommand from devcontainer.json...

[7386 ms] Start: Run in container: /bin/sh -c ./.devcontainer/postCreateCommand.sh
The virtual environment found in /workspaces/peloton-virtual-coach/.venv seems to be broken.
Recreating virtualenv peloton-virtual-coach in /workspaces/peloton-virtual-coach/.venv

[Errno 13] Permission denied: 'extensions.cpython-311.pyc'
[7955 ms] postCreateCommand failed with exit code 1. Skipping any further user-provided commands.
Done. Press any key to close the terminal.
```

I have the following:

`devcontainer.json`:
```json
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "peloton-virtual-coach",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
"features": {
"ghcr.io/devcontainers-contrib/features/poetry:2": {}
},

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "./.devcontainer/postCreateCommand.sh",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"editorconfig.editorconfig",
],
"settings": {
"python.testing.pytestArgs": ["tests"],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.defaultInterpreterPath": "/workspaces/peloton-virtual-coach/.venv/bin/python",
"python.testing.pytestPath": "/workspaces/peloton-virtual-coach/.venv/bin/pytest"
}
}
}
}
```

`postCreateCommand.sh`:
```
#! /usr/bin/env bash

# Install Dependencies
poetry install --with dev
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.