Dockerfile.j2 1.1 KB

12345678910111213141516171819202122
  1. # Molecule managed
  2. {% if item.registry is defined %}
  3. FROM {{ item.registry.url }}/{{ item.image }}
  4. {% else %}
  5. FROM {{ item.image }}
  6. {% endif %}
  7. {% if item.env is defined %}
  8. {% for var, value in item.env.items() %}
  9. {% if value %}
  10. ENV {{ var }} {{ value }}
  11. {% endif %}
  12. {% endfor %}
  13. {% endif %}
  14. RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates iproute2 && apt-get clean; \
  15. elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash iproute && dnf clean all; \
  16. elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash iproute && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
  17. elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml iproute2 && zypper clean -a; \
  18. elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
  19. elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates iproute2 && xbps-remove -O; fi