# vim: ft=dockerfile
# Define the names/tags of the container
#!BuildTag: cobbler-test-github:release34 cobbler-test-github:release34.%RELEASE%

# We are using https://github.com/hadolint/hadolint to lint our Dockerfile.
# We don't want to version pin our dependencies for testing. Always retrieve what is up to date.
# hadolint global ignore=DL3037

FROM registry.suse.com/bci/bci-base:16.0

# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=org.opensuse.example
LABEL org.opencontainers.image.title="cobbler-tftp"
LABEL org.opencontainers.image.description="This image runs the (nearly) stateless Cobbler TFTP server."
LABEL org.opencontainers.image.version="release34.%RELEASE%"
LABEL org.opensuse.reference="registry.opensuse.org/systemsmanagement/cobbler/release40/cobbler-tftp:release34.%RELEASE%"
LABEL org.openbuildservice.disturl="%DISTURL%"
LABEL org.opencontainers.image.created="%BUILDTIME%"
# endlabelprefix

# ENV Variables we are using.
ENV container=docker
ENV COBBLER_TFTP__TFTP__PORT=6969

# Custom repository
RUN zypper ar https://download.opensuse.org/repositories/openSUSE:/Leap:/16.0/standard/openSUSE:Leap:16.0.repo \
    && zypper ar https://download.opensuse.org/repositories/systemsmanagement:/cobbler:/release40/16.0/ "Cobbler 4.0.x release project" \
    && zypper --gpg-auto-import-keys refresh

# Cobbler-TFTP and tftp client
RUN zypper in -y cobbler-tftp tftp \
    && zypper clean

USER 1000

EXPOSE 6969/udp
CMD ["cobbler-tftp", "start", "--no-daemon"]
