Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ All notable changes to this project will be documented in this file.
- java-base: Add needed tzdata-java package ([#425]).
- testing-tools: Add java, tzdata-java, unzip ([#464], [#465], [#466]).

- zookeeper: add version 3.8.3 ([#470]).
- zookeeper: add upload script ([#470]).

### Changed

- Extract image tools their own [repository](https://github.com/stackabletech/image-tools) ([#437])
Expand All @@ -34,6 +37,8 @@ All notable changes to this project will be documented in this file.
- pyspark-k8s: The PySpark image has been removed completely. Python is now installed with the Spark image ([#436])
- Removed all product specific changelogs and updated the root file ([#440])

- zookeeper: removed versions 3.5.8, 3.6.3, 3.7.0, 3.8.0 ([#470]).

[#400]: https://github.com/stackabletech/docker-images/pull/400
[#419]: https://github.com/stackabletech/docker-images/pull/419
[#425]: https://github.com/stackabletech/docker-images/pull/425
Expand All @@ -49,6 +54,7 @@ All notable changes to this project will be documented in this file.
[#464]: https://github.com/stackabletech/docker-images/pull/464
[#465]: https://github.com/stackabletech/docker-images/pull/465
[#466]: https://github.com/stackabletech/docker-images/pull/466
[#470]: https://github.com/stackabletech/docker-images/pull/470
[#479]: https://github.com/stackabletech/docker-images/pull/479

## [23.7.0] - 2023-07-14
Expand Down
8 changes: 2 additions & 6 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,10 @@
"versions": [{"product": "0.2.0"}],
},
{
# ZooKeeper must be at least 3.5.0
"name": "zookeeper",
"versions": [
{"product": "3.5.8", "java-base": "11", "jmx_exporter": "0.16.1"},
{"product": "3.6.3", "java-base": "11", "jmx_exporter": "0.16.1"},
{"product": "3.7.0", "java-base": "11", "jmx_exporter": "0.16.1"},
{"product": "3.8.0", "java-base": "11", "jmx_exporter": "0.16.1"},
{"product": "3.8.1", "java-base": "11", "jmx_exporter": "0.18.0"},
{"product": "3.8.1", "java-base": "11", "jmx_exporter": "0.20.0"},
{"product": "3.8.3", "java-base": "11", "jmx_exporter": "0.20.0"},
],
},
{
Expand Down
13 changes: 6 additions & 7 deletions zookeeper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN microdnf update && \
microdnf install tar gzip zip && \
microdnf install openssl && \
microdnf clean all

COPY --chown=stackable:stackable zookeeper/stackable /stackable
Expand All @@ -27,13 +26,13 @@ COPY zookeeper/licenses /licenses
USER stackable
WORKDIR /stackable

RUN curl -L https://repo.stackable.tech/repository/packages/zookeeper/apache-zookeeper-${PRODUCT}-bin.tar.gz | tar -xzC . && \
ln -s /stackable/apache-zookeeper-${PRODUCT}-bin /stackable/zookeeper
RUN curl --fail -L "https://repo.stackable.tech/repository/packages/zookeeper/apache-zookeeper-${PRODUCT}-bin.tar.gz" | tar -xzC . && \
ln -s "/stackable/apache-zookeeper-${PRODUCT}-bin" /stackable/zookeeper

RUN curl https://repo.stackable.tech/repository/packages/jmx-exporter/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar \
-o /stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar && \
chmod +x /stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar && \
ln -s /stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar /stackable/jmx/jmx_prometheus_javaagent.jar
RUN curl --fail "https://repo.stackable.tech/repository/packages/jmx-exporter/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" \
-o "/stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" && \
chmod +x "/stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" && \
ln -s "/stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" /stackable/jmx/jmx_prometheus_javaagent.jar

# ===
# Mitigation for CVE-2021-44228 (Log4Shell)
Expand Down
69 changes: 69 additions & 0 deletions zookeeper/upload_new_zookeeper_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/usr/bin/env bash

VERSION=${1:?"Missing version number argument (arg 1)"}
NEXUS_USER=${2:?"Missing Nexus username argument (arg 2)"}

read -r -s -p "Nexus Password: " NEXUS_PASSWORD
echo ""

# https://stackoverflow.com/questions/4632028/how-to-create-a-temporary-directory
# Find the directory name of the script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# the temp directory used, within $DIR
WORK_DIR=$(mktemp -d -p "$DIR")

# check if tmp dir was created
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
echo "Could not create temp dir"
exit 1
fi

# deletes the temp directory
function cleanup {
rm -rf "$WORK_DIR"
}

# register the cleanup function to be called on the EXIT signal
trap cleanup EXIT

cd "$WORK_DIR" || exit

bin_file=apache-zookeeper-$VERSION-bin.tar.gz
download_url=https://archive.apache.org/dist/zookeeper

echo "Downloading ZooKeeper (this can take a while, it is intentionally downloading from a slow mirror that contains all old versions)"
curl --fail -LOs "$download_url/zookeeper-$VERSION/$bin_file"
curl --fail -LOs "$download_url/zookeeper-$VERSION/$bin_file.asc"
curl --fail -LOs "$download_url/zookeeper-$VERSION/$bin_file.sha512"

# It is probably redundant to check both the checksum and the signature but it's cheap and why not
echo "Validating SHA512 Checksums"
if ! (sha512sum "$bin_file" | diff -Z - "$bin_file.sha512"); then
echo "ERROR: One of the SHA512 sums does not match"
exit 1
fi

echo "Validating signatures"
echo '--> NOTE: Make sure you have downloaded and added the KEYS file (https://archive.apache.org/dist/zookeeper/KEYS) to GPG: https://www.apache.org/info/verification.html'

if ! (gpg --verify "$bin_file.asc" "$bin_file" 2> /dev/null); then
echo "ERROR: One of the signatures could not be verified"
exit 1
fi

echo "Uploading everything to Nexus"
EXIT_STATUS=0
repo_url=https://repo.stackable.tech/repository/packages/zookeeper/

curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "$bin_file" "$repo_url" || EXIT_STATUS=$?
curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "$bin_file.asc" "$repo_url" || EXIT_STATUS=$?
curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "$bin_file.sha512" "$repo_url" || EXIT_STATUS=$?

if [ $EXIT_STATUS -ne 0 ]; then
echo "ERROR: Upload failed"
exit 1
fi

echo "Successfully uploaded version $VERSION of ZooKeeper to Nexus"
echo "https://repo.stackable.tech/service/rest/repository/browse/packages/zookeeper/"