[openstack-exporter] Switch to jammy base
+ create a single Dockerfile for different Ubuntu versions + upgrade prometheus-client to a compatible version Change-Id: I121ee0e174b8cbc5f52c371a9b56a8dc6b981d15
This commit is contained in:
26
prometheus-openstack-exporter/Dockerfile.ubuntu
Normal file
26
prometheus-openstack-exporter/Dockerfile.ubuntu
Normal file
@@ -0,0 +1,26 @@
|
||||
ARG FROM=docker.io/ubuntu:jammy
|
||||
FROM ${FROM}
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get -y update \
|
||||
&& apt-get install --no-install-recommends -y \
|
||||
curl \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python3-setuptools \
|
||||
&& pip3 install --upgrade pip \
|
||||
&& pip3 install --no-cache-dir \
|
||||
python-dateutil \
|
||||
requests \
|
||||
simplejson \
|
||||
pyyaml \
|
||||
prometheus-client==0.0.21 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN mkdir /usr/local/bin/exporter
|
||||
COPY exporter /usr/local/bin/exporter
|
||||
RUN chmod +x /usr/local/bin/exporter/main.py
|
||||
|
||||
EXPOSE 9103
|
||||
|
||||
CMD ["/usr/local/bin/exporter/main.py"]
|
@@ -1,17 +0,0 @@
|
||||
ARG FROM=docker.io/ubuntu:bionic
|
||||
FROM ${FROM}
|
||||
|
||||
RUN apt-get -y update \
|
||||
&& apt-get install --no-install-recommends -y python3 python3-pip curl python3-setuptools \
|
||||
&& python3 -m pip install --upgrade pip \
|
||||
&& python3 -m pip install python-dateutil requests simplejson pyyaml prometheus-client==0.0.13 \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN mkdir /usr/local/bin/exporter
|
||||
COPY exporter /usr/local/bin/exporter
|
||||
RUN chmod +x /usr/local/bin/exporter/main.py
|
||||
|
||||
EXPOSE 9103
|
||||
|
||||
CMD ["/usr/local/bin/exporter/main.py"]
|
@@ -6,9 +6,10 @@ cd ${SCRIPT_DIR}/..
|
||||
|
||||
IMAGE="prometheus-openstack-exporter"
|
||||
VERSION=${VERSION:-latest}
|
||||
DISTRO=${DISTRO:-ubuntu_bionic}
|
||||
DISTRO=${DISTRO:-ubuntu}
|
||||
DISTRO_VERSION=${DISTRO_VERSION:-jammy}
|
||||
REGISTRY_URI=${REGISTRY_URI:-"openstackhelm/"}
|
||||
EXTRA_TAG_INFO=${EXTRA_TAG_INFO:-""}
|
||||
docker build -f ${IMAGE}/Dockerfile.${DISTRO} --network=host -t ${REGISTRY_URI}${IMAGE}:${VERSION}-${DISTRO}${EXTRA_TAG_INFO} ${extra_build_args} ${IMAGE}
|
||||
docker build -f ${IMAGE}/Dockerfile.${DISTRO} --network=host --build-arg="FROM=${DISTRO}:${DISTRO_VERSION}" -t ${REGISTRY_URI}${IMAGE}:${VERSION}-${DISTRO}${EXTRA_TAG_INFO} ${extra_build_args} ${IMAGE}
|
||||
|
||||
cd -
|
||||
|
@@ -37,10 +37,12 @@
|
||||
docker_images:
|
||||
- context: prometheus-openstack-exporter
|
||||
repository: openstackhelm/prometheus-openstack-exporter
|
||||
dockerfile: Dockerfile.ubuntu_bionic
|
||||
dockerfile: Dockerfile.ubuntu
|
||||
build_args:
|
||||
- "FROM=docker.io/ubuntu:jammy"
|
||||
tags:
|
||||
- latest-ubuntu_bionic
|
||||
- "ubuntu_bionic-{{ currentdate }}"
|
||||
- latest-ubuntu_jammy
|
||||
- "ubuntu_jammy-{{ currentdate }}"
|
||||
files: &prometheus-openstack-exporter_files
|
||||
- prometheus-openstack-exporter/.*
|
||||
- zuul.d/prometheus-openstack-exporter.yaml
|
||||
|
Reference in New Issue
Block a user