2019-11-21 19:53:30 +01:00
|
|
|
# Molecule managed
|
|
|
|
|
|
|
|
{% if item.registry is defined %}
|
|
|
|
FROM {{ item.registry.url }}/{{ item.image }}
|
|
|
|
{% else %}
|
|
|
|
FROM {{ item.image }}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if item.env is defined %}
|
|
|
|
{% for var, value in item.env.items() %}
|
|
|
|
{% if value %}
|
|
|
|
ENV {{ var }} {{ value }}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
RUN \
|
|
|
|
if [ $(command -v apt-get) ]; then \
|
|
|
|
apt-get update \
|
|
|
|
&& apt-get install -y python sudo bash ca-certificates iproute2 curl \
|
|
|
|
&& apt-get clean; \
|
2019-11-26 22:12:09 +01:00
|
|
|
elif [ $(command -v dnf) ] && [ $(rpm -E %{rhel}) -eq 8 ]; then \
|
|
|
|
dnf makecache \
|
|
|
|
&& dnf --assumeyes install python3 python3-devel python3-dnf python3-pip bash iproute \
|
|
|
|
&& dnf clean all; \
|
2019-11-21 19:53:30 +01:00
|
|
|
elif [ $(command -v dnf) ]; then \
|
|
|
|
dnf makecache \
|
|
|
|
&& dnf --assumeyes install python sudo python-devel python*-dnf bash iproute \
|
|
|
|
&& dnf clean all; \
|
|
|
|
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; \
|
|
|
|
elif [ $(command -v zypper) ]; then \
|
|
|
|
zypper refresh \
|
|
|
|
&& zypper install -y python sudo bash python-xml iproute2 \
|
|
|
|
&& zypper clean -a; \
|
|
|
|
elif [ $(command -v apk) ]; then \
|
|
|
|
apk update \
|
2019-11-22 15:52:34 +01:00
|
|
|
&& apk add --no-cache python sudo bash ca-certificates curl openrc; \
|
|
|
|
echo 'rc_provide="loopback net"' >> /etc/rc.conf; \
|
2019-11-21 19:53:30 +01:00
|
|
|
elif [ $(command -v xbps-install) ]; then \
|
|
|
|
xbps-install -Syu \
|
|
|
|
&& xbps-install -y python sudo bash ca-certificates iproute2 \
|
|
|
|
&& xbps-remove -O; \
|
|
|
|
fi
|