简体   繁体   English

docker-compose bitnami kafka容器我没有名字

[英]docker-compose bitnami kafka container I have no name

I'm trying to get a kafka instance going inside a docker container.我试图让一个 kafka 实例进入 docker 容器。 The docker-compose.yml looks like this: docker-compose.yml 如下所示:

version: '2'

services:
  zookeeper:
    image: 'bitnami/zookeeper:3'
    ports:
      - '2181:2181'
    volumes:
      - 'zookeeper_data:/bitnami'
    environment:
      - ALLOW_ANONYMOUS_LOGIN=yes
  kafka:
    image: 'bitnami/kafka:2'
    ports:
      - '9092:9092'
    volumes:
      - 'kafka_data:/bitnami'
    environment:
      - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
      - ALLOW_PLAINTEXT_LISTENER=yes
      - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092
      - KAFKA_CREATE_TOPICS=A_TOPIC,ANOTHER_TOPIC
    depends_on:
      - zookeeper

volumes:
  zookeeper_data:
    driver: local
  kafka_data:
    driver: local

The container gives no evident errors when I run docker-compose up .当我运行docker-compose up时,容器没有给出明显的错误。 However, when I connect to the container's shell但是,当我连接到容器的 shell

docker exec -it [container] /bin/bash

I see我懂了

I have no name!@7fe183af5e2a:/$

where 7fe183af5e2a is the container.其中 7fe183af5e2a 是容器。

Any reason for I have no name! I have no name! ? ? Am I missing something simple?我错过了一些简单的东西吗?

If you look at the Dockerfile for the Kafka image (the Zookeeper one is similar), you'll see that the user used in the container is the one with the uid 1001 .如果您查看 Kafka 映像的Dockerfile (Zookeeper 类似),您会看到容器中使用的用户是具有 uid 1001的用户。

So when you see I have no name.@... , this simply means that there is no user mapped to the uid 1001. You can verify that if you look into the file /etc/passwd you won't see any entry for a user with the id 1001.因此,当您看到I have no name.@...时,这仅表示没有用户映射到 uid 1001。您可以验证,如果您查看文件/etc/passwd ,您将看不到任何条目id 为 1001 的用户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 容器名称的Docker-Compose问题 - Docker-Compose Issue with container name docker-compose 更改主容器的名称 - docker-compose change name of main container Bitnami Kafka/Zookeper docker-compose 得到我:KeeperErrorCode = NoAuth for /consumers - Bitnami Kafka/Zookeper docker-compose gets me : KeeperErrorCode = NoAuth for /consumers 如何在 docker-compose 导致的 kafka 容器上安装 kafkacat - How to install kafkacat on kafka container resulted from docker-compose Docker-Compose 中 Docker Syslog 标签中的镜像名称、容器名称 - Image Name, Container Name in Docker Syslog Tag in Docker-Compose 带有容器名称的Docker-Compose容器IP地址 - Docker-Compose container ip address with container name docker-compose 从容器内部获取容器名称 - docker-compose get Container Name from inside of the Container 使用 docker-compose 设置 Kafka - Kafka setup with docker-compose docker-compose up 和 docker-compose exec 不使用相同的容器名称 - docker-compose up and docker-compose exec don't use the same container name 我从我拥有的另一个项目中复制了一个 docker-compose,当我运行它时出现错误,提示容器名称已在使用中 - I copied a docker-compose from another project I have, when I run it I get an error saying the container name is already in use
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM