Skip to content

Container not started #220

@marc-remijn-deltafiber

Description

@marc-remijn-deltafiber

I have installed the perl extension in vscode.
At the top of my project .vscode/settings.json looks like:

{
    "perl.containerCmd": "docker",
    "perl.containerMode": "run",
    "perl.containerName": "docker-repo.intern:8082/caiw/imta-re:latest",
    "perl.containerArgs": [
        "-v",
        "${workspaceFolder}:/usr/local/imta",
    ],
    "perl.pathMap": [
        [
        "file:///usr/local/imta",
        "file:///${workspaceFolder}/app"
        ]
    ]
}

Docker is running OK on the host. I can run containers from the command line. All docker commands like run, exec and image work fine.

Opening the project in vscode however wasn't a succes.
First I got a message that the languageserver crashed. The output of Perl::LanguageServer showed an error complaining the -M flag wan't understood. OK, it might be starting bash.

So how do I change the containerArgs to tell docker run to put /usr/bin/perl behind the image name. Where are these containerArgs being inserted inside the docker run command?

docker run <containerArgs> <image> <????> where is coming from the confusingly named containerName

How can I indicate that /usr/bin/perl is inserted behind the image name?

OK, maybe I need --entrypoint, so
So I need to tell the extension to start perl, so I changed the containerargs to:

    "perl.containerArgs": [
        "--entrypoint",
        "perl",
        "-v",
        "${workspaceFolder}:/usr/local/imta",
    ],

When I start vscode and open the project's directory, I don't see any attempt of a container being started whatsoever.

I don't even see a Perl::LanguageServer output anymore in the output pane of vscode.

What I want is quite simple. VScode <-----> container. Inside the container are perl and dependencies for my application and the perl languageserver. I want to be able to edit the project files inside VScode on the host, the project dir is mounted inside the container. So editing in vscod on host, running inside of the container. The languageserver inside that container providing me with autocompletion and finding definitions etc. I just can't find any good documentation on how to achieve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions