Skip to content
Discussion options

You must be logged in to vote

I've got Consul running in a Docker container:

  Consul:
    image: hashicorp/consul
    container_name: consul
    ports:
      - "8500:8500"
      - "8600:8600/udp"
    command: >
      consul agent -server -bootstrap-expect=1 -ui -node=consul-server 
      -client=0.0.0.0 -bind=0.0.0.0 -data-dir=/consul/data
    volumes:
      - ./data/consul:/consul/data
    networks:
      - myNetwork

And in the same Docker network I've got my API gateway using Ocelot and Ocelot.Provider.Consul.

Alright! What is the hostname of the Consul container in myNetwork? You can check all hosts in the Docker network using the bash command:

docker network inspect myNetwork -f '{{ range $id, $container := .Co…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by raman-m
Comment options

You must be logged in to vote
3 replies
@raman-m
Comment options

@cda963
Comment options

@cda963
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Service Discovery Ocelot feature: Service Discovery Consul Service discovery by Consul
2 participants
Converted from issue

This discussion was converted from issue #2311 on September 04, 2025 10:19.