Skip to content

Neutron

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

This container packages the Neutron 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 Neutron]
    D --> E[Container ready]
    Ovs --> 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 BUILT_TAG=v3.5.1-latest
FROM ghcr.io/rackerlabs/genestack-images/ovs:${BUILT_TAG} AS dependency_build
ARG OS_VERSION=master
ARG OS_CONSTRAINTS=master
ARG RXT_VERSION=master
RUN export DEBIAN_FRONTEND=noninteractive \
  && apt-get update && apt-get upgrade -y \
  && apt-get install --no-install-recommends -y \
                                             dh-autoreconf \
                                             bash \
                                             brotli \
                                             build-essential \
                                             curl \
                                             docutils-common \
                                             gettext \
                                             git \
                                             libffi-dev \
                                             libjs-sphinxdoc \
                                             libjs-underscore \
                                             libldap2-dev \
                                             libpq-dev \
                                             libsasl2-dev \
                                             libssl-dev \
                                             libsystemd-dev \
                                             libxml2-dev \
                                             libxslt1-dev \
                                             libxslt1.1 \
                                             pkg-config \
                                             ssl-cert \
                                             xmlsec1
RUN /var/lib/openstack/bin/pip install --constraint https://opendev.org/openstack/requirements/raw/branch/${OS_CONSTRAINTS}/upper-constraints.txt \
                                       git+https://opendev.org/openstack/ovn-bgp-agent@${OS_VERSION}#egg=ovn-bgp-agent \
                                       git+https://github.com/rackerlabs/neutron.git@${RXT_VERSION}#egg=neutron \
                                       git+https://opendev.org/openstack/neutron-dynamic-routing@${OS_VERSION}#egg=neutron-dynamic-routing \
                                       git+https://opendev.org/openstack/neutron-fwaas@${OS_VERSION}#egg=neutron-fwaas \
                                       git+https://opendev.org/openstack/neutron-vpnaas@${OS_VERSION}#egg=neutron-vpnaas \
                                       PyMySQL \
                                       graphviz \
                                       netaddr \
                                       python-memcached \
                                       uwsgi

COPY scripts/neutron-cve-patching.sh /opt/
RUN bash /opt/neutron-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


FROM ghcr.io/rackerlabs/genestack-images/ovs:${BUILT_TAG}
LABEL maintainer="Rackspace"
LABEL vendor="Rackspace OpenStack Team"
LABEL org.opencontainers.image.name="neutron"
LABEL org.opencontainers.image.description="OpenStack Service (neutron) built for the enterprise."
COPY --from=dependency_build /var/lib/openstack /var/lib/openstack
RUN export DEBIAN_FRONTEND=noninteractive \
  && apt-get update && apt-get upgrade -y \
  && apt-get install --no-install-recommends -y conntrack \
                                                dnsmasq-base \
                                                dnsmasq-utils \
                                                ebtables \
                                                haproxy \
                                                ipset \
                                                iptables \
                                                iputils-arping \
                                                keepalived \
                                                libatomic1 \
                                                libbpf1 \
                                                libcap-ng0 \
                                                libnuma1 \
                                                libssl3 \
                                                libstrongswan-standard-plugins \
                                                libunbound8 \
                                                libunwind8 \
                                                libxdp1 \
                                                net-tools \
                                                openssl \
                                                procps \
                                                radvd \
                                                strongswan \
                                                sudo \
  && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
  && 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 neutron \
  && useradd --system --gid 42424 --uid 42424 --shell /sbin/nologin --create-home --home /var/lib/neutron neutron \
  && mkdir -p /var/lib/openstack/etc/neutron \
  && ln -s /var/lib/openstack/etc/neutron /etc/neutron \
  && chown neutron:neutron -h /etc/neutron \
  && chown -R neutron:neutron /var/lib/openstack/etc/neutron
# Set the environment variables for the neutron 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 neutron-manage command
ENTRYPOINT ["/var/lib/openstack/bin/neutron-manage"]

Build Arguments

Argument Default
BUILT_TAG v3.5.1-latest
OS_VERSION master
OS_CONSTRAINTS master
RXT_VERSION master
Build Command
docker build \
--build-arg BUILT_TAG=v3.5.1-latest \
--build-arg OS_VERSION=master \
--build-arg OS_CONSTRAINTS=master \
--build-arg RXT_VERSION=master \
-f ContainerFiles/neutron \
-t neutron:local \
.

Dependencies

  • Builds From OvS

Container Image

The container image is available on Github Container Registry.