如何在 docker 上使用 Confluent CLI

JB-*_*JB- 5 confluent-platform confluent-cli

我已经在https://docs.confluent.io/current/quickstart/ce-docker-quickstart.html的帮助下使用 docker 在我的 Windows 10 上启动了 Confluent Platform 。现在我想尝试使用 Confluent CLI。但是我没有看到任何关于如何在 docker 上使用 confluent cli 的文档。你能建议我怎么做吗!

小智 6

Confluence 目前不提供 CLI 的 docker 镜像(据我所知)。在那之前,您可以在本地构建一个简单的映像来打包 CLI,以便使用该命令进行实验。

创造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
Run Code Online (Sandbox Code Playgroud)

然后构建:

docker build -t confluent-cli:latest .
Run Code Online (Sandbox Code Playgroud)

然后在 cp-all-in-one 网络上运行:

$ docker run -it --rm --network="cp-all-in-one_default" confluent-cli:latest bash
Run Code Online (Sandbox Code Playgroud)

然后从容器 shell 中使用以下命令进行实验:

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.
Run Code Online (Sandbox Code Playgroud)