FROM registry.opensuse.org/opensuse/leap
ENV container podman
ENV LANG en_US.UTF-8
RUN test ! -f /var/log/zypper.log || mv /var/log/zypper.log /var/log/zypper.log.preinstalled
# these are needed to run test
RUN zypper ar https://download.opensuse.org/repositories/openSUSE:/infrastructure/\$releasever/ infra && \
zypper --gpg-auto-import-keys ref
RUN ( zypper -vvvn ref || zypper -vvvn ref || zypper -vvvn ref ) && zypper -vvvn install systemd salt-minion curl sudo iputils python3-pygit2 ca-certificates-suse ca-certificates-freeipa-opensuse zypper-formula # needed for get_formulas.py
##DUMMY
RUN mkdir -p /srv/salt/ && \
sed -i 's^\#*\s*file_client: .*$^file_client: local\nsystemd.scope: False\nenable_fqdns_grains: False^' /etc/salt/minion && \
sed -i '/pam_systemd.so/d' /etc/pam.d/common-session-pc # delete pam_systemd , otherwise sudo will hang
ADD bin /test/bin
ADD pillar /test/pillar
WORKDIR /test
RUN bin/get_formulas.py -c -d /srv/formula -s --clone-from 'https://gitlab.infra.opensuse.org/saltstack-formulas' || bin/get_formulas.py -c -d /srv/formula -s --clone-from 'https://gitlab.infra.opensuse.org/saltstack-formulas'
RUN ( echo $'file_roots:\n\
base:\n\
- /srv/salt\n\
- /usr/share/salt-formulas/states' \
) >> /etc/salt/minion.d/roots.conf
ADD pillar/role /srv/pillar/role
COPY t/lib/*.sls /srv/pillar/
ADD salt /srv/salt
WORKDIR /opt/project
ENTRYPOINT ["/usr/lib/systemd/systemd"]