Skip to content

Expose get_host for use without a container. #876

Description

@bentheiii

When testing connectivity, we'd like to see what happens if a client starts up before a container-based service is available. For this reason, we'd like to be able to get the host name of a container before it actually starts, but the only way to get the host name (AFAICT) is through the get_host method of active containers.

I propose adding a new public function containers_host_name, with roughly the implementation:

pub async fn containers_host_name()->Result<Host>{
  Client::lazy_client().await?
    .docker_hostname().await
    .map_err(Into::into)
}

That will allow users to know the host names of containers before they start up.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions