Confluent cli and Confluent Docker

I am running Confluent according to step 1 in these instructions:

https://docs.confluent.io/platform/current/quickstart/ce-docker-quickstart.html

Works fine and I can open the web console.

I would like to use Confluent cli to interact with it, and have installed this “outside docker” in a folder on the same computer running docker.

How can I connect the confluent cli client to the Confluent instance running in the Docker container?

there should be a hidden directory
.confluent in your home directory
create java.config file there with the following:

bootstrap.servers={{ BROKER_ENDPOINT }}
security.protocol=SASL_SSL
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username='{{ CLUSTER_API_KEY }}' password='{{ CLUSTER_API_SECRET }}';
sasl.mechanism=PLAIN
client.dns.lookup=use_all_dns_ips
acks=all

for reference
https://docs.confluent.io/platform/current/tutorials/examples/clients/docs/confluent-cli.html

I am trying to use “confluent login” to log in to my cluster, but then I am asked for username and password. Where can I find the username and password to use?

I must also provide the --url parameter which points to “Metadata service URL. Must set flag or CONFLUENT_MDS_URL.” Where can I find this URL? Is it the broker URL/port?

broker            /etc/confluent/docker/run        Up      0.0.0.0:9092->9092/tcp,:::9092->9092/tcp,                                        
                                                           0.0.0.0:9101->9101/tcp,:::9101->9101/tcp

no it’s not the brokers URL

as you said above your configuration was done as described in the quickstart documentation

afaik there is no MDS configured at all and no need to use confluent login.

what would you like to do with the cluster?
produce some data?
check the config?

I am trying to follow this tutorial, and it uses confluent cli and not the web interface:

https://docs.confluent.io/platform/current/connect/quickstart.html

I see but in your first post you mentioned you’re trying to connect with cli from outside docker and that your setup ist docker-based.

so would please clarify what you try to do?
confluent local works, afaik, only with a local installation as described in
the mentioned quickstart.