diff --git a/CHANGELOG.md b/CHANGELOG.md index bbb5385da..ce599bb8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ All notable changes to this project will be documented in this file. `check-permissions-ownership.sh` provided in stackable-base image ([#1053]). - trino: check for correct permissions and ownerships in /stackable folder via `check-permissions-ownership.sh` provided in stackable-base image ([#1025]). +- zookeeper: check for correct permissions and ownerships in /stackable folder via + `check-permissions-ownership.sh` provided in stackable-base image ([#1043]). ### Changed @@ -40,11 +42,12 @@ All notable changes to this project will be documented in this file. - hbase: reduce docker image size by removing the recursive chown/chmods in the final image ([#1028]). - hive: reduce docker image size by removing the recursive chown/chmods in the final image ([#1040]). - kafka: reduce docker image size by removing the recursive chown/chmods in the final image ([#1041]). +- Add `--locked` flag to `cargo install` commands for reproducible builds ([#1044]). - nifi: reduce docker image size by removing the recursive chown/chmods in the final image ([#1027]). - opa: reduce docker image size by removing the recursive chown/chmods in the final image ([#1038]). - spark-k8s: reduce docker image size by removing the recursive chown/chmods in the final image ([#1042]). - trino: reduce docker image size by removing the recursive chown/chmods in the final image ([#1025]). -- Add `--locked` flag to `cargo install` commands for reproducible builds ([#1044]). +- zookeeper: reduce docker image size by removing the recursive chown/chmods in the final image ([#1043]). [#1025]: https://github.com/stackabletech/docker-images/pull/1025 [#1027]: https://github.com/stackabletech/docker-images/pull/1027 @@ -56,6 +59,7 @@ All notable changes to this project will be documented in this file. [#1040]: https://github.com/stackabletech/docker-images/pull/1040 [#1041]: https://github.com/stackabletech/docker-images/pull/1041 [#1042]: https://github.com/stackabletech/docker-images/pull/1042 +[#1043]: https://github.com/stackabletech/docker-images/pull/1043 [#1044]: https://github.com/stackabletech/docker-images/pull/1044 [#1050]: https://github.com/stackabletech/docker-images/pull/1050 [#1053]: https://github.com/stackabletech/docker-images/pull/1053 diff --git a/zookeeper/Dockerfile b/zookeeper/Dockerfile index 6b316cc10..c1ab00829 100644 --- a/zookeeper/Dockerfile +++ b/zookeeper/Dockerfile @@ -17,44 +17,35 @@ USER ${STACKABLE_USER_UID} WORKDIR /stackable # Download ZooKeeper sources from our own repo -RUN curl "https://repo.stackable.tech/repository/packages/zookeeper/apache-zookeeper-${PRODUCT}.tar.gz" | tar -xzC . && \ - # Apply any required patches - patches/apply_patches.sh ${PRODUCT} && \ - cd /stackable/apache-zookeeper-${PRODUCT}/ && \ - # Exclude the `zookeeper-client` submodule, this is not needed and has c parts - # that created all kinds of issues for the build container - mvn --batch-mode --no-transfer-progress -pl "!zookeeper-client/zookeeper-client-c" clean install checkstyle:check spotbugs:check -DskipTests -Pfull-build && \ - mv zookeeper-assembly/target/apache-zookeeper-${PRODUCT}-bin.tar.gz /stackable && \ - cd /stackable && \ - # Unpack the archive which contains the build artifacts from above. Remove some - # unused files to shrink the final image size. - tar xvzf /stackable/apache-zookeeper-${PRODUCT}-bin.tar.gz && \ - mv /stackable/apache-zookeeper-${PRODUCT}/zookeeper-assembly/target/bom.json /stackable/apache-zookeeper-${PRODUCT}-bin/apache-zookeeper-${PRODUCT}.cdx.json && \ - rm -rf /stackable/apache-zookeeper-${PRODUCT}-bin/docs && \ - rm /stackable/apache-zookeeper-${PRODUCT}-bin/README_packaging.md && \ - # Download the JMX exporter jar from our own repo - 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 - -# === -# For earlier versions this script removes the .class file that contains the -# vulnerable code. -# TODO: This can be restricted to target only versions which do not honor the environment -# varible that has been set above but this has not currently been implemented -COPY shared/log4shell.sh /bin -RUN /bin/log4shell.sh /stackable/apache-zookeeper-${PRODUCT}-bin - -# Ensure no vulnerable files are left over -# This will currently report vulnerable files being present, as it also alerts -# on SocketNode.class, which we do not remove with our scripts. Further -# investigation will be needed whether this should also be removed. -COPY shared/log4shell_1.6.1-log4shell_Linux_x86_64 /bin/log4shell_scanner_x86_64 -COPY shared/log4shell_1.6.1-log4shell_Linux_aarch64 /bin/log4shell_scanner_aarch64 -COPY shared/log4shell_scanner /bin/log4shell_scanner -RUN /bin/log4shell_scanner s /stackable/apache-zookeeper-${PRODUCT}-bin -# === +RUN < /stackable/package_manifest.txt && \ - rm -rf /var/cache/yum - -WORKDIR /stackable +LABEL \ + name="Apache ZooKeeper" \ + maintainer="info@stackable.tech" \ + vendor="Stackable GmbH" \ + version="${PRODUCT}" \ + release="${RELEASE}" \ + summary="The Stackable image for Apache ZooKeeper." \ + description="This image is deployed by the Stackable Operator for Apache ZooKeeper." # Copy over the ZooKeeper binary folder COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/apache-zookeeper-${PRODUCT}-bin /stackable/apache-zookeeper-${PRODUCT}-bin/ COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/jmx /stackable/jmx/ COPY zookeeper/licenses /licenses +RUN < /stackable/package_manifest.txt +chown ${STACKABLE_USER_UID}:0 /stackable/package_manifest.txt +chmod g=u /stackable/package_manifest.txt +rm -rf /var/cache/yum + # Add link pointing from /stackable/zookeeper to /stackable/apache-zookeeper-${PRODUCT}-bin/ # to preserve the folder name with the version. -RUN <