This is an automated email from the ASF dual-hosted git repository.

manikumar pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new e610767f959 MINOR: Add documentation for docker image github actions 
(#14952)
e610767f959 is described below

commit e610767f9592987dd91a00d2a4f95b2636b322b6
Author: Vedarth Sharma <[email protected]>
AuthorDate: Thu Dec 7 16:28:59 2023 +0530

    MINOR: Add documentation for docker image github actions (#14952)
    
    Reviewers: Manikumar Reddy <[email protected]>
---
 .github/workflows/docker_promote.yml    |  8 +++----
 .github/workflows/docker_rc_release.yml |  6 ++---
 docker/README.md                        | 39 +++++++++++++++++++++++++++++----
 3 files changed, 42 insertions(+), 11 deletions(-)

diff --git a/.github/workflows/docker_promote.yml 
b/.github/workflows/docker_promote.yml
index 060048223af..5f3a1de4063 100644
--- a/.github/workflows/docker_promote.yml
+++ b/.github/workflows/docker_promote.yml
@@ -13,16 +13,16 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-name: Promote RC Docker Image
+name: Promote Release Candidate Docker Image
 
 on:
   workflow_dispatch:
     inputs:
       rc_docker_image:
-        description: RC docker image that needs to be promoted to apache/kafka
+        description: RC docker image that needs to be promoted (Example:- 
apache/kafka:3.6.0-rc0)
         required: true
       promoted_docker_image:
-        description: Docker image name of the promoted image
+        description: Docker image name of the promoted image (Example:- 
apache/kafka:3.6.0)
         required: true
 
 jobs:
@@ -33,7 +33,7 @@ jobs:
     - name: Login to Docker Hub
       uses: docker/login-action@v3
       with:
-        username: ${{ secrets.DOCKERHUB_USERNAME }}
+        username: ${{ secrets.DOCKERHUB_USER }}
         password: ${{ secrets.DOCKERHUB_TOKEN }}
     - name: Copy RC Image to apache/kafka
       uses: imjasonh/[email protected]
diff --git a/.github/workflows/docker_rc_release.yml 
b/.github/workflows/docker_rc_release.yml
index 87401d7c617..c7082dcac91 100644
--- a/.github/workflows/docker_rc_release.yml
+++ b/.github/workflows/docker_rc_release.yml
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-name: Build and Push RC Docker Image
+name: Build and Push Release Candidate Docker Image
 
 on:
   workflow_dispatch:
@@ -24,7 +24,7 @@ on:
         options: 
           - "jvm"
       rc_docker_image:
-        description: RC docker image that needs to be built and pushed to 
Dockerhub
+        description: RC docker image that needs to be built and pushed to 
Dockerhub (Example:- apache/kafka:3.6.0-rc0)
         required: true
       kafka_url:
         description: Kafka url to be used to build the docker image
@@ -52,7 +52,7 @@ jobs:
     - name: Login to Docker Hub
       uses: docker/login-action@v3
       with:
-        username: ${{ secrets.DOCKERHUB_USERNAME }}
+        username: ${{ secrets.DOCKERHUB_USER }}
         password: ${{ secrets.DOCKERHUB_TOKEN }}
     - name: Release the RC docker image
       run: |
diff --git a/docker/README.md b/docker/README.md
index f4036b156c6..3640302b1c6 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -3,6 +3,10 @@ Docker Images
 
 This directory contains scripts to build, test, push and promote docker image 
for kafka.
 
+Repository Setup
+----------------
+Make sure the `DOCKERHUB_USER` and `DOCKERHUB_TOKEN` secrets are added and 
made available to Github Actions in Github Repository settings. This is 
required for pushing the docker image.
+
 Local Setup
 -----------
 Make sure you have python (>= 3.7.x) and java (>= 17) (java needed only for 
running tests) installed before running the tests and scripts.
@@ -41,8 +45,8 @@ image_type: jvm
 kafka_url: https://archive.apache.org/dist/kafka/3.6.0/kafka_2.13-3.6.0.tgz
 ```
 
-Creating a release
-------------------
+Creating a Release Candidate
+----------------------------
 - `docker_release.py` script builds a multi-architecture image and pushes it 
to provided docker registry.
 - Ensure you are logged in to the docker registry before triggering the script.
 - kafka binary tarball url along with image name (in the format 
`<registry>/<namespace>/<image_name>:<image_tag>`) and type is needed to build 
the image. For detailed usage description check `python docker_release.py 
--help`.
@@ -57,10 +61,37 @@ python docker_release.py kafka/test:3.6.0 --kafka-url 
https://archive.apache.org
 
 Please note that we use docker buildx for preparing the multi-architecture 
image and pushing it to docker registry. It's possible to encounter build 
failures because of buildx. Please retry the command in case some buildx 
related error occurs.
 
-Promoting a release
--------------------
+Creating a Release Candidate using github actions
+-------------------------------------------------
+This is the recommended way to push an RC docker image.
+Go to `Build and Push Release Candidate Docker Image` Github Actions Workflow.
+Choose the `image_type` and and provide `kafka_url` that needs to be 
containerised in the `rc_docker_image` that will be pushed to github.
+
+Example:-
+If you want to push a jvm image which contains kafka from 
https://archive.apache.org/dist/kafka/3.6.0/kafka_2.13-3.6.0.tgz to dockerhub 
under the namespace apache, repo name as kafka and image tag as 3.6.0-rc1 then 
following values need to be added in Github Actions Workflow:-
+```
+image_type: jvm
+kafka_url: https://archive.apache.org/dist/kafka/3.6.0/kafka_2.13-3.6.0.tgz
+rc_docker_image: apache/kafka:3.6.0-rc0
+```
+
+Promoting a Release Candidate
+-----------------------------
 `docker_promote.py` provides an interactive way to pull an RC Docker image and 
promote it to required dockerhub repo.
 
+Promoting a Release Candidate using github actions
+--------------------------------------------------
+This is the recommended way to promote an RC docker image.
+Go to `Promote Release Candidate Docker Image` Github Actions Workflow.
+Choose the RC docker image (`rc_docker_image`) that you want to promote and 
where it needs to be pushed to (`promoted_docker_image`), i.e. the final docker 
image release. 
+
+Example:-
+If you want to promote apache/kafka:3.6.0-rc0 RC docker image to 
apache/kafka:3.6.0 then following parameters can be provided to the workflow.
+```
+rc_docker_image: apache/kafka:3.6.0-rc0
+promoted_docker_image: apache/kafka:3.6.0
+```
+
 Using the image in a docker container
 -------------------------------------
 - The image uses the kafka downloaded from provided kafka url

Reply via email to