Dockerfile for Metricbeat based on ubi8

Hi everyone,

we are trying to build a Metricbeat Image based on ubi8. There are a lot of information's but no one explaines how this can be archived.

I reverse engineered the official Image but there must be another way to build the Image correctly. Some files are missing too (docker-entrypoint, licenses). I am new to containerisation and would appreciate help.

Could someone give advice how we can build this with a Dockerfile and ubi8?

FROM docker.elastic.co/beats/metricbeat:7.11.0
ADD file:b3ebbe8bd304723d43b7b44a6d990cd657b63d93d6a2a9293983a30bfc1dfa53 in /
LABEL org.label-schema.schema-version=1.0 org.label-schema.name=CentOS Base Image org.label-schema.vendor=CentOS org.label-schema.license=GPLv2 org.label-schema.build-date=20201113 org.opencontainers.image.title=CentOS Base Image org.opencontainers.image.vendor=CentOS org.opencontainers.image.licenses=GPL-2.0-only org.opencontainers.image.created=2020-11-13 00:00:00+00:00
CMD ["/bin/bash"]
RUN /bin/sh -c yum -y --setopt=tsflags=nodocs update \
    && yum clean all
LABEL org.label-schema.build-date=2021-02-08T22:52:45Z org.label-schema.schema-version=1.0 org.label-schema.vendor=Elastic org.label-schema.license=Elastic License org.label-schema.name=metricbeat org.label-schema.version=7.11.0 org.label-schema.url=https://www.elastic.co/products/beats/metricbeat org.label-schema.vcs-url=github.com/elastic/beats/v7 org.label-schema.vcs-ref=84c4d4c4034fcb49c1a318ccdc7311d70adee15b io.k8s.description=Metricbeat is a lightweight shipper for metrics. io.k8s.display-name=Metricbeat image org.opencontainers.image.created=2021-02-08T22:52:45Z org.opencontainers.image.licenses=Elastic License org.opencontainers.image.title=Metricbeat org.opencontainers.image.vendor=Elastic name=metricbeat maintainer=infra@elastic.co vendor=Elastic version=7.11.0 release=1 url=https://www.elastic.co/products/beats/metricbeat summary=metricbeat license=Elastic License description=Metricbeat is a lightweight shipper for metrics.
ENV ELASTIC_CONTAINER=true
ENV PATH=/usr/share/metricbeat:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV GODEBUG=madvdontneed=1
RUN /bin/sh -c set -e ;   TINI_VERSION='v0.19.0' ;   TINI_BIN='tini-amd64' ;   TINI_SHA256='93dcc18adc78c65a028a84799ecf8ad40c936fdfc5f2a57b1acda5a8117fa82c' ;   curl --retry 8 -S -L -O "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/${TINI_BIN}" ;   echo "${TINI_SHA256} ${TINI_BIN}" | sha256sum -c - ;   mv "${TINI_BIN}" /usr/bin/tini ;   chmod +x /usr/bin/tini
COPY file:0c7d6c5e7a9eb5b92e259f2240c93301dd7753f797052ab786ec388e1df59c6d in /usr/local/bin/docker-entrypoint
RUN /bin/sh -c chmod 755 /usr/local/bin/docker-entrypoint
COPY dir:09dc8cb6603b804a522bc18146951c214bab2ae305c7119180642b7ecc16958e in /usr/share/metricbeat
RUN /bin/sh -c mkdir /licenses
COPY file:cdbc231fbc5655dba62a5dfcd044a7cd1f1ff5c6ed03d382f939f06965440fa3 in /licenses
COPY file:9697170cbb2eabaa1fb3217b51c56b81ef5be1a8d0d7eb1243c52286dde3ce48 in /licenses
RUN /bin/sh -c groupadd --gid 1000 metricbeat
RUN /bin/sh -c useradd -M --uid 1000 --gid 1000 --groups 0 --home /usr/share/metricbeat metricbeat
USER metricbeat
ENV LIBBEAT_MONITORING_CGROUPS_HIERARCHY_OVERRIDE=/
WORKDIR /usr/share/metricbeat
ENTRYPOINT ["/usr/bin/tini" "--" "/usr/local/bin/docker-entrypoint"]
CMD ["-environment" "container"]

Hi!

Can't you start from a ubi8 container image and build Metricbeat from source inside it?