Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 99078

How do I specify the dockerfile stage in Visual Studio Code Remote?

$
0
0

I have a multi-stage Dockerfile. I want to configure VS Code Remote to build the dev stage of the Dockerfile rather than the last stage in the Dockerfile.

I'm pretty sure this configuration would go in the .devcontainer.json file. I've read through the .devcontainer.json reference: https://code.visualstudio.com/docs/remote/containers#_devcontainerjson-reference and tried runArgs, but these are the run-time args, not the build args.

I tried this:

{
        "dockerFile": "Dockerfile",
        "extensions": ["ms-python.python"],
        "runArgs": [
                "--target",
                "dev"
        ]
}

and:

{
        "dockerFile": "Dockerfile",
        "extensions": ["ms-python.python"],
        "buildArgs": [
                "--target",
                "dev"
        ]
}

When I used runArgs, I got Failed: Starting the development container because target is not a docker run option. When I tried buildArgs, the argument was apparently ignored, which makes sense since it isn't listed in the documentation.


Viewing all articles
Browse latest Browse all 99078

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>