Skip to content

Commit

Permalink
Fixing few issues, changing order of keyservers
Browse files Browse the repository at this point in the history
  • Loading branch information
KrishVora2912 committed Aug 13, 2024
1 parent a63adc4 commit d08cf6a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
13 changes: 6 additions & 7 deletions docker/jvm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ RUN set -eux ; \
wget -nv -O kafka.tgz "$kafka_url"; \
wget -nv -O kafka.tgz.asc "$kafka_url.asc"; \
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys "$GPG_KEY" || \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY" ; \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY" || \
gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys "$GPG_KEY" ; \
gpg --batch --verify kafka.tgz.asc kafka.tgz; \
gpgconf --kill all; \
rm -rf "$GNUPGHOME" kafka.tgz.asc;

RUN mkdir opt/kafka; \
rm -rf "$GNUPGHOME" kafka.tgz.asc; \
mkdir opt/kafka; \
tar xfz kafka.tgz -C /opt/kafka --strip-components 1; \
# Generate jsa files using dynamic CDS for kafka server start command and kafka storage format command
/etc/kafka/docker/jsa_launch
Expand All @@ -62,8 +61,8 @@ RUN set -eux ; \
wget -nv -O kafka.tgz "$kafka_url"; \
wget -nv -O kafka.tgz.asc "$kafka_url.asc"; \
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys "$GPG_KEY" || \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY" ; \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY" || \
gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys "$GPG_KEY" ; \
gpg --batch --verify kafka.tgz.asc kafka.tgz; \
gpgconf --kill all; \
rm -rf "$GNUPGHOME" kafka.tgz.asc; \
Expand Down
4 changes: 2 additions & 2 deletions docker/native/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ RUN mkdir $KAFKA_DIR; \
wget -nv -O kafka.tgz "$KAFKA_URL"; \
wget -nv -O kafka.tgz.asc "$KAFKA_URL.asc"; \
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys "$GPG_KEY" || \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY" ; \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$GPG_KEY" || \
gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys "$GPG_KEY" ; \
gpg --batch --verify kafka.tgz.asc kafka.tgz; \
gpgconf --kill all; \
rm -rf "$GNUPGHOME" kafka.tgz.asc; \
Expand Down
2 changes: 1 addition & 1 deletion docker/prepare_docker_official_image_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def remove_args_and_hardcode_values(file_path, kafka_version, kafka_url):
filedata = filedata.replace(
"ARG build_date", f"ENV build_date {str(date.today())}")
# Replace "$GPG_KEY" with the actual GPG key
filedata = filedata.replace("$GPG_KEY", get_gpg_key(kafka_version))
filedata = filedata.replace('"$GPG_KEY"', get_gpg_key(kafka_version))
original_comment = re.compile(r"# Get kafka from https://archive.apache.org/dist/kafka and pass the url through build arguments")
updated_comment = f"# Get Kafka from https://archive.apache.org/dist/kafka, url passed as env var, for version {kafka_version}"
filedata = original_comment.sub(updated_comment, filedata)
Expand Down

0 comments on commit d08cf6a

Please sign in to comment.