FROM fedora:33
ARG TARGETPLATFORM

WORKDIR /var/submariner

RUN dnf -y install --nodocs --setopt=install_weak_deps=0 \
           iproute iptables iptables-nft && \
    dnf -y clean all

COPY package/submariner-globalnet.sh bin/${TARGETPLATFORM}/submariner-globalnet /usr/local/bin/

# Wrapper scripts to choose the appropriate iptables
# https://github.com/kubernetes-sigs/iptables-wrappers
COPY package/iptables-wrapper-installer.sh /usr/sbin/
RUN /usr/sbin/iptables-wrapper-installer.sh

ENTRYPOINT submariner-globalnet.sh
