Current state: Under Discussion
Discussion thread: here [Not started]
JIRA: here
This KIP aims to introduce Docker Official Image (DOI) for Apache Kafka, ensuring the Kafka Docker images adhere to Docker's quality standards.
Several other Apache projects, like Flink, Spark, Solr, have already released Docker Official Images, with download figures ranging from 50 million to over 1 billion. These numbers highlight the significant demand among users. Also the Docker Official Images are always the top 1 search result, irrespective of the number of downloads. This visibility guarantees that over time, a larger number of users will opt for Docker images provided by the Apache Kafka community. The support from these Apache projects indicates that we can achieve similar success with Apache Kafka.
Post-support, the Dockerfile for Apache Kafka will continue to be managed by the Apache Kafka community and undergo review by Docker. The Docker community will oversee the images' maintenance, aligning them with Docker's quality standards.
Add public documentation in Official Docker Image Repo.
There will be a docker official image as an additional artifact for every Apache Kafka release. The docker files for the same will be maintained by the Apache Kafka community, but the images will be maintained by the Docker community.
This docker official image, like the existing OSS sponsored images, will consist of JVM based Kafka and will have support for Linux based AMD and ARM architectures.
Update the release process to include release of docker official image.
We will need to make sure to carry out the necessary modifications to ensure our Dockerfile aligns with the guidelines and criteria established for Official Docker Images, and ensure that it adheres to Docker's best practices. We will take steps to ensure our image aligns with the below pointers.
The New Image checklist - NEW-IMAGE-CHECKLIST.md
Best practices for Dockerfile instructions - Best practices for Dockerfile instructions
General best practices for writing Dockerfiles - General best practices for writing Dockerfiles
Review Guidelines: https://github.com/docker-library/official-images/blob/master/README.md#review-guidelines
This step is necessary because the Dockerfiles will be subject to review by the Dockerhub team, and will require back-and-forth communication with them.
Initial Setup:
Establish a new directory, docker/docker_official_images, within trunk to keep Docker Official Image assets.
Ensure dockerfile is compliant as per Docker Official Images guidelines.
Release Candidate (RC) Preparation:
RM would have generated and pushed Apache Kafka's Release Candidate tarball to apache sftp server hosted in home.apache.org by release.py script.
For all subsequent steps - the above Release Candidate tarball URL will be used.
Docker Image Preparation via GitHub Actions:
Implement an automated GitHub Actions workflow to:
Generate a version-specific folder, following the major_version.minor_version.patch_version-rc naming scheme, under the docker/docker_official_images directory, for housing static Dockerfile and scripts.
With each new RC, this folder will be overwritten.
This folder will contain all static files necessary for creating the docker image.
The github actions workflow generates this folder which can be downloaded and verified.
The RM checks if there is already a folder with the same name in trunk. If yes, he deletes this, and put this folder under the docker/docker_official_images directory in his fork of the kafka repo, and merges this change into the official kafka repo by raising a PR. To make this step more automated, we will do the same via a script that takes in the local path of the downloaded artifact as an input.
Review and Integration:
Upon PR approval and merge, RM will cherry-pick the changes into the designated branch.
Docker Build and Release Testing:
Perform Docker build tests to ensure image integrity. The dockerfiles for the same will be used from the specific folder in the docker/docker_official_images directory.
Start the Voting for RC, which will include the Docker image, docker sanity tests report and docker official image source folder.
In case any docker image specific issue is detected, that will be evaluated by the community, if it’s a release blocker or not.
Once the vote passes, run the Docker release pipeline to publish RC images to the Docker Hub open-source software (OSS) sponsored images. The image will be pushed to OSS sponsored apache/kafka with the version as tag.
Iterative RC Updates:
Repeat steps 2 through 5 for subsequent RCs, ensuring the repository contains the latest RC.
Final Release Promotion:
Upon final release approval, run the Docker promote pipeline from the RC branch to the OSS Docker Hub. The latest major_version.minor_version.patch_version image will now be available on the OSS Docker Hub.
Post-Release Maintenance:
Return to the trunk to perform maintenance tasks:
Remove unsupported version folders from the docker_official_images directory to maintain repository cleanliness.
Remove the -rc identifier from the major_version.minor_version.patch_version-rc folder. This serves as the new source of truth for the DOI. Ensure that the folder of the version being released does not have the -rc tag at the end.
Docker Hub Submission:
Submit the final PR to Docker Hub’s official images repository. Following PR approval, the Kafka Docker image becomes officially available.
A new directory named docker_official_images will be added to the /docker repository. This directory will contain all the Official Docker Images related code.
kafka/
- docker/
- docker_official_images/ #Contains resources needed to create the official docker images.
- 3.8.2-rc/ #Contains resources needed to create the docker images for the latest RC tag for the 3.8.2 version.
- jvm/ #Contains Dockerfile for the JVM-based Apache Kafka Docker image.
- Dockerfile + necessary scripts
- 3.8.1/ #Contains resources needed to create the official docker images for the 3.8.1 version.
- jvm/ #Contains Dockerfile for the JVM-based Apache Kafka Official Docker image.
- Dockerfile + necessary scripts
- 3.9.0/
- jvm/
- Dockerfile + necessary scripts
- jvm/
- Dockerfile #Dockerfile for the JVM-based Apache Kafka Docker image.
- resources/ #Contains resources needed to create the Docker image.
- test/ #Contains sanity tests for the Docker image.
- docker_build_test.py #Python script for building and testing the Docker image.
- docker_release.py #Python script for building the Docker image and pushing it to Docker Hub.
- docker_build_latest_artifact.py #Python script for building the artifact for the current RC release. |
Existing tests for docker image should pass.
Creating a separate repository named apache-docker within the Apache GitHub organization. This strategy mirrors the practices of other Apache projects, such as Spark and Flink, where Docker-related files and scripts reside in a distinct repository. However, this move would involve transferring existing Docker resources to the new repository too, without providing any added advantage. This approach does not provide any benefit in the requirement for creating specific folders with hardcoded values for each Docker image release.