Skip to content

postCreateCommand Permission denied #247

Open
@austinmw

Description

@austinmw
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:

// 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    info-neededInformation needed form the user

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions