# SPDX-License-Identifier: (LGPL-2.1+ AND GPL-2.0+)

#     Copyright (c) 2024 SUSE LLC

# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon.

# The content of THIS FILE IS AUTOGENERATED and should not be manually modified.
# It is maintained by the BCI team and generated by
# https://github.com/SUSE/BCI-dockerfile-generator

# Please submit bugfixes or comments via https://bugs.opensuse.org/
# You can contact the BCI team via https://github.com/SUSE/bci/discussions


#!BuildTag: suse/pcp:%%pcp_patch%%
#!BuildTag: suse/pcp:%%pcp_patch%%-%RELEASE%
#!BuildTag: suse/pcp:%%pcp_minor%%
#!BuildTag: suse/pcp:%%pcp_minor%%-%RELEASE%
#!BuildTag: suse/pcp:%%pcp_major%%
#!BuildTag: suse/pcp:%%pcp_major%%-%RELEASE%
#!BuildTag: suse/pcp:latest
#!BuildName: suse-pcp-%%pcp_patch%%
#!BuildVersion: 15.5
FROM bci/bci-init:15.5

MAINTAINER SUSE LLC (https://www.suse.com/)

# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=com.suse.application.pcp
LABEL org.opencontainers.image.title="SLE Performance Co-Pilot (pcp)"
LABEL org.opencontainers.image.description="Performance Co-Pilot (pcp) container based on the SLE Base Container Image. This container is only supported with podman."
LABEL org.opencontainers.image.version="%%pcp_patch%%"
LABEL org.opencontainers.image.url="https://www.suse.com/products/base-container-images/"
LABEL org.opencontainers.image.created="%BUILDTIME%"
LABEL org.opencontainers.image.vendor="SUSE LLC"
LABEL org.opencontainers.image.source="%SOURCEURL%"
LABEL io.artifacthub.package.readme-url="%SOURCEURL%/README.md"
LABEL org.opensuse.reference="registry.suse.com/suse/pcp:%%pcp_patch%%-%RELEASE%"
LABEL org.openbuildservice.disturl="%DISTURL%"
LABEL com.suse.supportlevel="l3"
LABEL com.suse.eula="sle-bci"
LABEL com.suse.lifecycle-url="https://www.suse.com/lifecycle#suse-linux-enterprise-server-15"
LABEL com.suse.release-stage="released"
# endlabelprefix

RUN set -euo pipefail; zypper -n in --no-recommends pcp hostname shadow gettext-runtime util-linux-systemd; zypper -n clean; rm -rf /var/log/*
ENTRYPOINT ["/usr/local/bin/container-entrypoint"]
CMD ["/usr/lib/systemd/systemd"]
EXPOSE 44321 44322 44323

RUN set -euo pipefail; mkdir -p /usr/share/container-scripts/pcp; mkdir -p /etc/sysconfig
COPY container-entrypoint healthcheck /usr/local/bin/
RUN set -euo pipefail; chmod +x /usr/local/bin/container-entrypoint /usr/local/bin/healthcheck
COPY pmproxy.conf.template 10-host_mount.conf.template /usr/share/container-scripts/pcp/
COPY pmcd pmlogger /etc/sysconfig/

# This can be removed after the pcp dependency on sysconfig is removed
RUN set -euo pipefail; systemctl disable wicked wickedd || :

HEALTHCHECK --start-period=30s --timeout=20s --interval=10s --retries=3     CMD /usr/local/bin/healthcheck

VOLUME /var/log/pcp/pmlogger
