[英]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.