Skip to content

Cinder

The cinder image is built from ContainerFiles/cinder. Security patches are applied by scripts/cinder-cve-patching.sh.

This container packages the Cinder service for use in the stack. The build installs the required packages, applies security updates and configuration, and prepares the service for integration.

graph LR
    A[Base image] --> B[Install packages]
    B --> C[Apply CVE patches]
    C --> D[Configure Cinder]
    D --> E[Container ready]
    Openstack_Venv --> A
ContainerFile used for the build
# syntax = docker/dockerfile:1
# This Dockerfile uses multi-stage build to customize DEV and PROD images:
# https://docs.docker.com/develop/develop-images/multistage-build/

ARG OS_VERSION=master
ARG OS_CONSTRAINTS=master

FROM ubuntu:noble AS base

ARG OS_VERSION
ARG OS_CONSTRAINTS

RUN apt-get update \
  && apt-get install -y --no-install-recommends \
               build-essential \
               git \
               libffi-dev \
               libssl-dev \
               libxml2-dev \
               libxslt1-dev \
               python3 \
               python3-dev \
               python3-venv \
               python3-pip \
  && rm -rf /var/lib/apt/lists/*

RUN python3 -m venv --system-site-packages /var/lib/openstack \
  && /var/lib/openstack/bin/pip install --upgrade pip \
  && /var/lib/openstack/bin/pip install --constraint https://opendev.org/openstack/requirements/raw/branch/${OS_CONSTRAINTS}/upper-constraints.txt \
                                               git+https://opendev.org/openstack/cinder.git@${OS_VERSION}#egg=cinder \
                                               cryptography \
                                               ecdsa \
                                               PyMySQL \
                                               python-memcached \
                                               os-brick \
                                               purestorage \
                                               py-pure-client \
                                               uwsgi

COPY scripts/cinder-cve-patching.sh /opt/
RUN bash /opt/cinder-cve-patching.sh

RUN find / -name '*.pyc' -delete \
  && find / -name '*.pyo' -delete \
  && find / -name '__pycache__' -delete \
  && find / -name '*.whl' -delete \
  && rm -f /var/lib/openstack/lib/python*/site-packages/slapdtest/certs/client.key \
  && rm -f /var/lib/openstack/lib/python*/site-packages/slapdtest/certs/server.key \
  && sed -i '/^Usage/,/^Documentation\n^-.*$/d' /var/lib/openstack/lib/python*/site-packages/PyJWT-*.dist-info/METADATA || true


FROM ubuntu:noble
LABEL maintainer="Rackspace"
LABEL vendor="Rackspace OpenStack Team"
LABEL org.opencontainers.image.name="cinder"
LABEL org.opencontainers.image.description="OpenStack Service (cinder) built for the enterprise."
COPY --from=base /var/lib/openstack /var/lib/openstack

RUN apt-get update \
  && apt-get install -y --no-install-recommends ceph-common python3-rbd python3-rados python3-cephfs python3-ceph-common python3-ceph-argparse libxml2 multipath-tools open-iscsi qemu-utils lsscsi nvme-cli sudo nfs-common uwsgi uwsgi-plugin-python3 \
  && apt-get purge -y --auto-remove \
  && apt-get clean -y \
  && rm -rf /var/lib/apt/lists/* \
  && find / -name '*.pyc' -delete \
  && find / -name '*.pyo' -delete \
  && find / -name '__pycache__' -delete \
  && groupadd --system --gid 42424 cinder \
  && useradd --system --gid 42424 --uid 42424 --shell /sbin/nologin --create-home --home /var/lib/cinder cinder \
  && mkdir -p /var/lib/openstack/etc/cinder \
  && mkdir -p /var/lib/cinder/mnt \
  && ln -s /var/lib/openstack/etc/cinder /etc/cinder \
  && chown cinder:cinder -h /etc/cinder \
  && chown -R cinder:cinder /var/lib/openstack/etc/cinder \
                                 /var/lib/cinder/mnt

# Set the environment variables for the cinder venv
ENV PATH="/var/lib/openstack/bin:$PATH"
# Set the working directory
WORKDIR /var/lib/openstack
# Set the user and group to match the original build
USER 42424:42424
# Set the entrypoint to the cinder-manage command
ENTRYPOINT ["/var/lib/openstack/bin/cinder-manage"]

Build Arguments

Argument Default
VENV_TAG 3.12-latest
CACHEBUST 0
OS_VERSION master
OS_CONSTRAINTS master
Build Command
docker build \
--build-arg VENV_TAG=3.12-latest \
--build-arg CACHEBUST=0 \
--build-arg OS_VERSION=master \
--build-arg OS_CONSTRAINTS=master \
-f ContainerFiles/cinder \
-t cinder:local \
.

Dependencies

Container Image

The container image is available on Github Container Registry.