Skip to content

[proposal] Support for container name option in devcontainer.json #184

Open

Description

@kotokaze

For ease of identification, we have a case to name the container at runtime.
It is helpful if there is an option like container_name as in docker-compose.


Current:

{
  "name": "some-name-here",  // This is not used for container name
  "runArgs": ["--name", "${localWorkspaceFolderBasename}"],  // Use WS basename for example
  ...
}

Proposed:

{
  "name": "some-name-here",
  "container_name: "${localWorkspaceFolderBasename}",  // Field name comes from docker-compose
  ...
}

Activity

  1. samruddhikhandale commented on Jan 19, 2023

    @samruddhikhandale
    Member

    Hi 👋

    I agree, it is a good feature request.

    Are you aware of the --id-label flag for the devcontainer up command? In the meanwhile, it could help name the devcontainer.

    image

  2. exhuma commented on Sep 15, 2023

    @exhuma

    Unfortunately the --id-label is not exposed in the devcontainer.json file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions