#!BuildTag: trento/trento-runner:latest
#!BuildTag: trento/trento-runner:%PKG_VERSION%
#!BuildTag: trento/trento-runner:%PKG_VERSION%-rev1.1.0
#!BuildTag: trento/trento-runner:%PKG_VERSION%-rev1.1.0-build%RELEASE%
FROM suse/sle15:15.3

# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=com.suse.trento
PREFIXEDLABEL org.opencontainers.image.title="Trento runner premium"
PREFIXEDLABEL org.opencontainers.image.description="This contains trento-premium runner %PKG_VERSION%"
PREFIXEDLABEL org.opensuse.reference="registry.suse.com/trento/trento-runner:%PKG_VERSION%"
PREFIXEDLABEL org.openbuildservice.disturl="%DISTURL%"
PREFIXEDLABEL org.opencontainers.image.created="%BUILDTIME%"

# Workaround for https://github.com/openSUSE/obs-build/issues/487
RUN zypper --non-interactive in sles-release

# Fill the image with content
RUN zypper --non-interactive in trento-premium openssh python3 python3-rpm python3-requests python3-PyYAML python3-Jinja2 ansible-core tini

# Temporary solution until we have ansible-4.6.0 packaged in IBS
COPY ansible-4.6.0.tar.gz /tmp/ansible-4.6.0.tar.gz
RUN zypper --non-interactive in python3-pip
RUN pip install --no-index --find-links /tmp /tmp/ansible-4.6.0.tar.gz

LABEL org.opencontainers.image.source="https://github.com/trento-project/trento"
ENTRYPOINT ["/tini", "--", "/usr/bin/trento"]
