Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): support for docker cli flag --add-host #547

Merged
merged 3 commits into from
Mar 9, 2024

Commits on Feb 15, 2024

  1. feat(cli): support for docker cli flag --add-host

    When spawning multiple docker containers in the same test,
    communication amongst them can achieved over the docker default
    gateway.
    
    In DinD environments such as when running jobs on a CI pipeline, the docker
    [`--add-host`](https://docs.docker.com/engine/reference/commandline/container_run/#option)
    can be employed to basically enter new entries in the `/etc/hosts`
    files. This allows to avoid binding all container ports to the host
    environment.
    
    The flag API counterpart is implemented on the `RunnableImage` struct
    instead of on the generic image since I reckon it makes more sense
    within this crate phylosophy, I hope !-).
    
    A test runs 2 containers:
    
    - an http_server
    - a `curl` client
    
    and the `curl` client completes when receiving `foo` from the server on the
    alias hostname. In case the hostname wasn't resolve it'd panic.
    amountainram committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    227a4d1 View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2024

  1. Configuration menu
    Copy the full SHA
    663b75b View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2024

  1. fix(test+lint): fix clippy lint warning and attempt on test fix

    it appears support of `--add-host` flag in Docker Remote API is somewhat
    clumsy, for instance
    [here](https://stackoverflow.com/questions/28081421/docker-add-hosts-flag-equivalent-in-remote-api)
    and related replies.
    
    It appears that the syntax `host:port` may be supported instead of
    `key=value`
    amountainram committed Mar 7, 2024
    Configuration menu
    Copy the full SHA
    26b9986 View commit details
    Browse the repository at this point in the history