kafka-docker: Can't run kafka container - sed: unmatched '@'
Hi,
I’m using a simple docker-compose configuration:
version: "3.4"
services:
zookeeper:
image: zookeeper
ports:
- "2181:2181"
kafka:
image: wurstmeister/kafka:2.12-2.5.0
ports:
- "9092:9092"
depends_on:
- zookeeper
environment:
KAFKA_ADVERTISED_HOST_NAME: 172.17.0.1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_MESSAGE_MAX_BYTES: 104858800
volumes:
- /var/run/docker.sock:/var/run/docker.sock
kafka-web-gui:
image: tchiotludo/akhq
ports:
- "8081:8080"
environment:
AKHQ_CONFIGURATION: |
akhq:
connections:
docker-kafka-server:
properties:
bootstrap.servers: "kafka:9092"
My stack is running without any problem in the first execution. But, when I try to run the kafka container again, I get the following error:
kafka_1 | [Configuring] ‘advertised.port’ in ‘/opt/kafka/config/server.properties’ kafka_1 | sed: unmatched ‘@’ kafka-deployment_kafka_1 exited with code 1
I use ubuntu 20.04 Docker version 20.10.6, build 370c289 docker-compose version 1.26.0, build d4451659
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 14
- Comments: 17 (1 by maintainers)
i had this error as well. i solved it by running
docker-compose downbefore re-runningdocker-compose upagainCuz the error shows something about
advertised.port. So I specify the advertised port = 9092. It’s working well. If the consumer/producer can’t receive/send data, remove the zookeeper and kafka container and compose up it again.this is because you are not tearing down the container. i don’t understand why after all of these comments in this thread there are still issues. run docker-compose down to tear it down properly. It seems that many users are still new to docker…
Personal story – I’ve resolved this by running
docker-compose down, after this –docker-compose -f ... upworks.I’ve contributed a PR to handle this issue. #674
Hello,
i’m experiencing the same error on
Linux version 5.4.0-72-generic (buildd@lcy01-amd64-019) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #80-Ubuntu SMP Mon Apr 12 17:35:00 UTC 2021
Client: Docker Engine - Community Version: 20.10.6 API version: 1.41 Go version: go1.13.15 Git commit: 370c289 Built: Fri Apr 9 22:47:17 2021 OS/Arch: linux/amd64 Context: default Experimental: true
docker-compose version 1.27.4, build 40524192
With the Dockerfile
Could this be related to some recent changes in Alpine?