FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)

{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}

RUN yum -y install \
        tftp-server \
        syslinux-tftpboot \
    && yum clean all \
    && mkdir -p /tftpboot \
    && cp /var/lib/tftpboot/chain.c32 /tftpboot

{% elif base_distro in ['ubuntu', 'debian'] %}

RUN apt-get install --no-install-recommends \
        tftpd-hpa \
        syslinux-common \
        pxelinux \
    && apt-get clean \
    && mkdir -p /tftpboot \
    && cp /usr/lib/syslinux/pxelinux.0 /var/lib/tftpboot/chain.c32 /tftpboot

{% endif %}

COPY tftp-map-file /tftpboot/map-file

{{ include_footer }}