confluentinc / cp-all-in-one

docker-compose.yml files for cp-all-in-one , cp-all-in-one-community, cp-all-in-one-cloud, Apache Kafka Confluent Platform
958 stars 684 forks source link

How to run the contents of update_run and /etc/confluent/docker/run inline without file #114

Closed jchannon closed 1 year ago

jchannon commented 1 year ago

Description I want to run the commands in the update_run.sh file and /etc/confluent/docker/run

Troubleshooting I tried:

    entrypoint: [ '/bin/sh', '-c' ]
    command: |
      "
        #!/bin/sh

        # Docker workaround: Remove check for KAFKA_ZOOKEEPER_CONNECT parameter
        sed -i '/KAFKA_ZOOKEEPER_CONNECT/d' /etc/confluent/docker/configure

        # Docker workaround: Ignore cub zk-ready
        sed -i 's/cub zk-ready/echo ignore zk-ready/' /etc/confluent/docker/ensure

        # KRaft required step: Format the storage directory with a new cluster ID
        echo "kafka-storage format --ignore-formatted --cluster-id=$(kafka-storage random-uuid) -c /etc/kafka/kafka.properties" >> /etc/confluent/docker/ensure

       /etc/confluent/docker/run
      "

Environment

jchannon commented 1 year ago

Fix is to use single quotes on the last KRaft line instead of double quotes