{"id":29273693,"url":"https://github.com/simplifi/kafka_docker","last_synced_at":"2025-07-05T02:36:35.580Z","repository":{"id":38064983,"uuid":"204570505","full_name":"simplifi/kafka_docker","owner":"simplifi","description":"docker-compose wrapper to bring up kafka and wait for topic creation","archived":false,"fork":false,"pushed_at":"2022-06-30T14:55:13.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":52,"default_branch":"master","last_synced_at":"2024-06-19T19:42:10.456Z","etag":null,"topics":["golang"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simplifi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2019-08-26T22:12:47.000Z","updated_at":"2022-12-13T13:23:58.000Z","dependencies_parsed_at":"2022-08-19T07:10:45.468Z","dependency_job_id":null,"html_url":"https://github.com/simplifi/kafka_docker","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/simplifi/kafka_docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplifi%2Fkafka_docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplifi%2Fkafka_docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplifi%2Fkafka_docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplifi%2Fkafka_docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplifi","download_url":"https://codeload.github.com/simplifi/kafka_docker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplifi%2Fkafka_docker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263671880,"owners_count":23494057,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang"],"created_at":"2025-07-05T02:36:34.600Z","updated_at":"2025-07-05T02:36:35.568Z","avatar_url":"https://github.com/simplifi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kafka_docker\n\nA docker-compose wrapper that brings up Kafka brokers, ensures the advertised listeners are correct, and ensures\nthat any topics that the Kafka container is creating via KAFKA_CREATE_TOPICS are in place before returning\n\n## Installation\n\n- Browse to the [Releases](https://github.com/simplifi/kafka_docker/releases)\n- Navigate to the latest release\n- Click to download the appropriate release for your platform\n- Once downloaded, extract, then move the binary into your path and make it executable\n  - example: `mv ~/Downloads/kafka_docker /usr/local/bin/kafka_docker \u0026\u0026 chmod +x /usr/local/bin/kafka_docker`\n\n## Requirements\n\n`kafka_docker` expects that you are using the [wurstmeister/kafka](https://hub.docker.com/r/wurstmeister/kafka/) images in a docker-compose.yml file, and that you are\nsetting the `KAFKA_CREATE_TOPICS` environment variable in the docker-compose.yml file.\n\nIt sets a `DOCKER_IP` environment variable which can be used in KAFKA_ADVERTISED_LISTENERS. For example, the following\nconfiguration brings up a 3-broker cluster, creates topics `topic1` and `topic2` with 12 partitions and 3 replicas,\nand allows access from the host system and also other containers:\n\n```\nversion: \"3.2\"\nservices:\n  zookeeper:\n    image: wurstmeister/zookeeper:3.4.6\n    ports:\n      - \"2181:2181\"\n  kafka1:\n    image: wurstmeister/kafka:2.11-1.1.1\n    ports:\n      - \"9092:9092\"\n    depends_on:\n      - zookeeper\n    environment:\n      KAFKA_CREATE_TOPICS: \"topic1:12:3,topic2:12:3\"\n      KAFKA_LISTENERS: \"PLAINTEXT://0.0.0.0:9092\"\n      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://${DOCKER_IP}:9092\n      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181\n  kafka2:\n    image: wurstmeister/kafka:2.11-1.1.1\n    ports:\n      - \"9093:9092\"\n    depends_on:\n      - zookeeper\n    environment:\n      KAFKA_LISTENERS: \"PLAINTEXT://0.0.0.0:9092\"\n      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://${DOCKER_IP}:9093\n      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181\n  kafka3:\n    image: wurstmeister/kafka:2.11-1.1.1\n    ports:\n      - \"9094:9092\"\n    depends_on:\n      - zookeeper\n    environment:\n      KAFKA_LISTENERS: \"PLAINTEXT://0.0.0.0:9092\"\n      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://${DOCKER_IP}:9094\n      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181\n```\n\n## Usage\n\nYou can see the options available to you by running kafka_docker without any arguments:\n\n```bash\nStart up docker-compose with kafka.\n\tScans the docker-compose.yml file and finds a kafka container, and ensures that the advertised connection\n\tis set correctly to allow the host to connect, but still allow inter-container communication.\n\n\tUsage:\n\tStarting up docker-compose:\n\tkafka_docker up [-f /path/to/docker-compose.yml]\n\n\tFor symmetry also there is kafka_docker down, which just calls docker-compose down.\n\n\tDefaults to looking in $PWD for the docker-compose.yml\n\nUsage:\n  kafka_docker [command]\n\nAvailable Commands:\n  down        Runs docker-compose down\n  help        Help about any command\n  ip          Outputs Docker IP\n  up          docker-compose up with extra options\n\nFlags:\n  -f, --file string   docker-compose file\n  -h, --help          help for kafka_docker\n\nUse \"kafka_docker [command] --help\" for more information about a command.\n```\n\n## Example Usages\nBring kafka containers online\n```\nkafka_docker up [-f|--file \u003cdocker-compose-file\u003e]\n```\nHalt kafka docker containers\n```\nkafka_docker down [-f|--file \u003cdocker-compose-file\u003e]\n```\nDisplay ip associated to docker containers\n```\nkafka_docker ip\n```\n\n## Development\n\n### Tool Setup\n\n[Install Golang](https://golang.org/doc/install)\n\n[Install golint](https://github.com/golang/lint#installation)\n\n[Install goreleaser](https://goreleaser.com/install/)\n\n## Testing\n\nTests are run via a Makefile. To download all dependencies, build, and run tests:\n```\nmake\n```\n\nAdditionally you can run linting with\n```\nmake lint\n```\n\nIt is strongly recommended that linting passes, but Travis-CI does not run the linters because golint specifies that\nit may have false positives and shouldn't be relied on automatically.\n\nOther make commands:\n```\n# Download dependencies:\nmake get\n# Compile project:\nmake build\n```\n\n### Releasing\n\n#### Automated\n\nThis project is using [goreleaser](https://goreleaser.com). GitHub release\ncreation is automated using Travis CI. New releases are automatically created\nwhen new tags are pushed to the repo.\n\n```shell script\n$ TAG=v0.1.0 make tag\n```\n\n#### Manual\n\nA release can also be manually pushed using goreleaser. You must have the\n`GITHUB_TOKEN` environment variable set to a GitHub token with the `repo` scope.\nYou can create a new github token [here](https://github.com/settings/tokens/new).\n\n```shell script\n$ make release\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplifi%2Fkafka_docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplifi%2Fkafka_docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplifi%2Fkafka_docker/lists"}