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 \
|
2020-03-25 18:43:32 +01:00
|
|
|
&& apt-get install -y python3 sudo bash ca-certificates iproute2 python3-apt aptitude systemd systemd-sysv procps curl \
|
2019-11-21 19:53:30 +01:00
|
|
|
&& apt-get clean; \
|
|
|
|
elif [ $(command -v dnf) ]; then \
|
|
|
|
dnf makecache \
|
2020-03-25 18:43:32 +01:00
|
|
|
&& dnf --assumeyes install /usr/bin/python3 /usr/bin/python3-config /usr/bin/dnf-3 bash iproute \
|
2019-11-21 19:53:30 +01:00
|
|
|
&& dnf clean all; \
|
|
|
|
elif [ $(command -v yum) ]; then \
|
|
|
|
yum makecache fast \
|
2020-03-25 18:43:32 +01:00
|
|
|
&& yum install -y /usr/bin/python /usr/bin/python2-config sudo yum-plugin-ovl bash iproute \
|
2019-11-21 19:53:30 +01:00
|
|
|
&& sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf \
|
|
|
|
&& yum clean all; \
|
|
|
|
elif [ $(command -v zypper) ]; then \
|
|
|
|
zypper refresh \
|
2020-03-25 18:43:32 +01:00
|
|
|
&& zypper install -y python3 sudo bash iproute2 \
|
2019-11-21 19:53:30 +01:00
|
|
|
&& zypper clean -a; \
|
|
|
|
elif [ $(command -v apk) ]; then \
|
|
|
|
apk update \
|
2020-03-25 18:43:32 +01:00
|
|
|
&& apk add --no-cache python3 sudo bash ca-certificates curl openrc; \
|
2019-11-22 15:52:34 +01:00
|
|
|
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 \
|
2020-03-25 18:43:32 +01:00
|
|
|
&& xbps-install -y python3 sudo bash ca-certificates iproute2 \
|
2019-11-21 19:53:30 +01:00
|
|
|
&& xbps-remove -O; \
|
|
|
|
fi
|