Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker-compose bitnami kafka container I have no name

I'm trying to get a kafka instance going inside a docker container. The docker-compose.yml looks like this:

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. However, when I connect to the container's shell

docker exec -it [container] /bin/bash

I see

I have no name!@7fe183af5e2a:/$

where 7fe183af5e2a is the container.

Any reason for I have no name!? Am I missing something simple?

like image 964
geco17 Avatar asked Oct 22 '25 14:10

geco17


1 Answers

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.

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.

like image 152
Marc ABOUCHACRA Avatar answered Oct 25 '25 07:10

Marc ABOUCHACRA



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!