如何在docker上使用Confluent CLI

问题描述 投票:0回答:1

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

confluent confluent-platform confluent-cli
1个回答
0
投票

Confluent目前不为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

然后使用:

docker build -t confluent-cli:latest .

然后使用以下命令在cp-all-in-one网络中运行:

$ docker run -it --rm --network="cp-all-in-one_default" confluent-cli:latest bash

然后从容器外壳中,通过命令进行实验:

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.
© www.soinside.com 2019 - 2024. All rights reserved.