# SPDX-License-Identifier: Apache-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

#!UseOBSRepositories
#!ExclusiveArch: aarch64 x86_64
#!BuildTag: containers/milvus:%%milvus_version%%-%RELEASE%
#!BuildTag: containers/milvus:%%milvus_version%%
#!BuildTag: containers/milvus:2.4
#!ForceMultiVersion
#!BuildName: containers-milvus-2.4
#!BuildVersion: %%milvus_version%%
#!BuildRelease: 0
FROM registry.suse.com/bci/bci-micro:15.6 AS target
FROM registry.suse.com/bci/bci-base:15.6 AS builder


COPY --from=target / /target

RUN set -euo pipefail; \
    zypper -n --installroot /target --gpg-auto-import-keys install --no-recommends libglog-4-0 etcd minio-client tini milvus milvus-cppcpu; \
    zypper -n clean; \
    rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}
RUN set -euo pipefail; mkdir /target/milvus && ln -s /etc/milvus/configs/ /target/milvus

# create the config for glog
COPY glog.conf /target/etc/milvus/configs/glog.conf
COPY embedEtcd.yaml /target/etc/milvus/configs/embedEtcd.yaml

# create the milvus start script
COPY start_milvus.sh /target/milvus/start_milvus.sh
RUN chmod 0755 /target/milvus/start_milvus.sh

FROM registry.suse.com/bci/bci-micro:15.6
COPY --from=builder /target /
# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=com.suse.application.milvus
LABEL org.opencontainers.image.authors=""
LABEL org.opencontainers.image.title="Milvus"
LABEL org.opencontainers.image.description="Milvus is a high-performance vector database built for scale. It is used by AI applications to organize and search through large amount of unstructured data, such as text, images, and multi-modal information."
LABEL org.opencontainers.image.version="%%milvus_version%%"
LABEL org.opencontainers.image.url="https://apps.rancher.io/applications/milvus"
LABEL org.opencontainers.image.created="%BUILDTIME%"
LABEL org.opencontainers.image.vendor="SUSE LLC"
LABEL org.opencontainers.image.source="%SOURCEURL%"
LABEL org.opencontainers.image.ref.name="%%milvus_version%%-%RELEASE%"
LABEL org.opensuse.reference="dp.apps.rancher.io/containers/milvus:%%milvus_version%%-%RELEASE%"
LABEL org.openbuildservice.disturl="%DISTURL%"
LABEL com.suse.supportlevel="l3"
LABEL com.suse.supportlevel.until="2025-12-31"
LABEL com.suse.eula="sle-eula"
LABEL com.suse.lifecycle-url="https://www.suse.com/lifecycle"
LABEL com.suse.release-stage="released"
# endlabelprefix
LABEL org.opencontainers.image.base.name="%BASE_IMAGE_TAG%"
LABEL org.opencontainers.image.base.digest="%BASE_DIGEST%"
LABEL io.artifacthub.package.readme-url="%SOURCEURL%/README.md"

ENTRYPOINT ["/milvus/start_milvus.sh"]

