-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alex Collins <[email protected]>
- Loading branch information
Showing
5 changed files
with
61 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/.git | ||
/.github | ||
/.idea | ||
/LICENSE | ||
/release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Publish Docker image | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
permissions: | ||
packages: write | ||
|
||
jobs: | ||
push_to_registry: | ||
name: Push Docker image to GitHub Packages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to Docker Hub | ||
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u kitproj --password-stdin | ||
|
||
- name: Build Docker image | ||
run: docker build . --tag ghcr.io/kitproj/kafka:latest | ||
|
||
- name: Tag Docker image | ||
run: docker tag ghcr.io/kitproj/kafka:latest ghcr.io/kitproj/kafka:${GITHUB_REF#refs/*/} | ||
|
||
- name: Push Docker images | ||
run: docker push -a ghcr.io/kitproj/kafka |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
# kafka-kraft | ||
# Kafka Docker | ||
|
||
A self-contained Docker image for Kafka. Only one image needed, no Zookeeper (it uses KRaft). So much much easier for use in automated tests. | ||
A self-contained Docker image for Kafka. Typically you must run multiple | ||
images ([example](https://developer.confluent.io/quickstart/kafka-docker/)). This only requires a single image. This | ||
reduces the complexity by an order of magnitude. | ||
|
||
## Usage | ||
On Docker: | ||
|
||
```bash | ||
docker run --rm -p 9092:9092 --name kafka alexcollinsintuit/kafka | ||
docker run --rm -p 9092:9092 --name kafka kitproj/kafka | ||
``` | ||
|
||
## Building | ||
On Kubernetes: | ||
|
||
```bash | ||
# build the image | ||
docker build --tag kafka . | ||
``` | ||
|
||
```bash | ||
# push to repository | ||
docker tag kafka alexcollinsintuit/kafka | ||
docker push alexcollinsintuit/kafka | ||
```yaml | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: kafka | ||
spec: | ||
containers: | ||
- name: main | ||
image: kitproj/kafka | ||
ports: | ||
- containerPort: 9092 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
command -v semver || go install github.com/ffurrer2/semver/v2/cmd/semver@latest | ||
|
||
git tag v$(semver next patch $(git tag|sort -V|tail -n1|cut -c 2-)) | ||
|
||
git push --tags |