[ 
https://issues.apache.org/jira/browse/KAFKA-17246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17870964#comment-17870964
 ] 

Vedarth Sharma commented on KAFKA-17246:
----------------------------------------

Issue with [~yangpoan]'s approach is that we also check for a signature file in 
Dockerfile, so this approach won't work as it is and will require some 
modification in Dockerfile.

A better solution would be to build our Dockerfile via scripts. When building 
the Dockerfile for testing, we can remove signature checks and replace the url 
download flow with copying the tarball received from the output of releaseTarGz 
command and when we build it for release, we will retain the current flow.

This will allow us to have a single source of truth for the Dockerfile for both 
local testing and final release.

So finally the steps will be something like this:-
 # Provide flag to `docker_build_test.py` whether we want to run it in 
'release' mode or 'test' mode.
 # Generate the Dockerfile accordingly.
 # In case it is release, kafka url will be required. Otherwise we will build 
the tarball.
 # For release we will fetch kafka from the url, for 'test' flow we will copy 
the tarball while building Docker image.

We can also consider modifying the script so that if kafka url is provided, we 
will use that and run the current flow, otherwise we will build from source and 
the generated Dockerfile will use that and won't have signature checks. This 
will ensure we don't introduce too many flags in the script.

Another benefit of this approach is in future if we want to make changes just 
for local testing flow, we can do that easily without affecting how release 
flow works.

This will also help in creating a job that will run Docker image tests on a PR, 
which was raised here

> Simplify the process of building a test docker image
> ----------------------------------------------------
>
>                 Key: KAFKA-17246
>                 URL: https://issues.apache.org/jira/browse/KAFKA-17246
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Mickael Maison
>            Priority: Major
>
> The docker_build_test.py script requires a URL and a signature file. This 
> makes it hard to build a test image locally with a custom Kafka binary.
> It would be nice to have a way to point it to a local distribution artifact 
> instead and ignore the signature check.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to