I have started Confluent Platform on my windows 10 using docker with the help of https://docs.confluent.io/current/quickstart/ce-docker-quickstart.html. Now I want to try using Confluent CLI. But I don't see any documentation on how to use confluent cli on docker. Can you please suggest me how can I do this !
How to use Confluent CLI on docker
Asked Answered
Confluent does not provide a docker image for the CLIs at this time (that I'm aware of). Until that time, you could build a simple image locally to package up the CLI for experimenting w/ the command.
Create Dockerfile
:
FROM ubuntu:latest
RUN apt update && apt upgrade
RUN apt install -y curl
RUN curl -L --http1.1 https://cnfl.io/cli | sh -s -- -b /usr/local/bin
Then build with:
docker build -t confluent-cli:latest .
Then run on the cp-all-in-one network with:
$ docker run -it --rm --network="cp-all-in-one_default" confluent-cli:latest bash
Then from the containers shell, experiement w/ the command:
root@421e53d4a04a:/# confluent
Manage your Confluent Platform.
Usage:
confluent [command]
Available Commands:
cluster Retrieve metadata about Confluent clusters.
completion Print shell completion code.
help Help about any command
iam Manage RBAC, ACL and IAM permissions.
local Manage a local Confluent Platform development environment.
login Log in to Confluent Platform (required for RBAC).
logout Logout of Confluent Platform.
secret Manage secrets for Confluent Platform.
update Update the confluent CLI.
version Print the confluent CLI version.
Flags:
-h, --help help for confluent
-v, --verbose count Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace).
--version version for confluent
Use "confluent [command] --help" for more information about a command.
Thank you @Rick, I'm going to try this now. Could you please assist me with how to use this cli to manage permissions on control center using
iam
–
Titrant @JB I'm sorry to say that the cp-all-in-one compose files do not bootstrap RBAC for Confluent Platform. One suggestion I have for you is to look at cp-demo (github.com/confluentinc/cp-demo) which does enable RBAC using LDAP. The demo has scripts which you can investiagte for usage. –
Kaoliang
@RickSpurgeon did you manage to login to the local cluster using confluent cli? –
Sinasinai
confluent login --url localhost:8091 --ca-cert-path scripts/security/snakeoil-ca-1.crt works but i cannot see clusters –
Sinasinai
Here is the image:
https://hub.docker.com/r/confluentinc/confluent-cli
Basically run the following commands:
devbox1@devbox1:~/onibex/wa$ docker pull confluentinc/confluent-cli
devbox1@devbox1:~/onibex/wa$ docker run confluentinc/confluent-cli
To check if the image was added:
devbox1@devbox1:~/onibex/wa$ docker ps -a | grep confluent-cli
a5ecf9223d35 confluentinc/confluent-cli
Add "sudo" if it is needed.
© 2022 - 2024 — McMap. All rights reserved.
kafka-console-consumer
you'd use the host name and a published port as the--bootstrap-server
. You shouldn't need theconfluent
command since all of the components are started by the provided Docker Compose setup. Is there a specific problem you're encountering, or a specific command you can't run? – Eurythmicconfluent-cli
using theiam
command – Titrant