/docker-images

Primary LanguageDockerfileApache License 2.0Apache-2.0

Stackable Docker Images

This repository contains Dockerfiles and scripts to build base images for use within Stackable.

ubi8-rust-builder

This image is meant to be used in multi-stage builds as a base image for projects building Rust projects.

The image will run cargo build --release in the current context and copy all binaries to an /app directory.

This will bake in the current stable Rust version at the time this image was built which means it should be rebuilt (and tagged) for every release of Rust.

Example usage
FROM docker.stackable.tech/ubi8-rust-builder AS builder

FROM registry.access.redhat.com/ubi8/ubi-minimal AS operator
LABEL maintainer="Stackable GmbH"

# Update image
RUN microdnf update --disablerepo=* --enablerepo=ubi-8-baseos-rpms --enablerepo=ubi-8-baseos-rpms -y \
  && rm -rf /var/cache/yum \
  && microdnf install --disablerepo=* --enablerepo=ubi-8-appstream-rpms --enablerepo=ubi-8-baseos-rpms shadow-utils -y \
  && rm -rf /var/cache/yum

COPY --from=builder /app/stackable-zookeeper-operator /

RUN groupadd -g 1000 stackable && adduser -u 1000 -g stackable -c 'Stackable Operator' stackable

USER 1000:1000

ENTRYPOINT ["/stackable-zookeeper-operator"]

Build Product Images

Product images are published to the docker.stackable.tech registry under the stackable organization. This uses the Docker CLI plugin buildx which is not necessarily installed by default when installing Docker. Make sure that docker buildx works before running the following commands.

To build and push product images to the default repository, use the build_product_images.py like this:

python -m image_tools.bake --product zookeeper --image 0.0.0-dev --push

This will build images for Apache ZooKeeper versions as defined in the image_tools/conf.py and tag them with the image-version 0.0.0-dev

The GitHub action called Product images can be triggered manually to do the same but not on the local machine.

Verify Product Images

To verify if Apache Zookeeper validate against OpenShift preflight, run:

python -m image_tools.preflight --product zookeeper --image 0.0.0-dev