44 lines
1.5 KiB
Django/Jinja
44 lines
1.5 KiB
Django/Jinja
# 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 \
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y aptitude bash curl dirmngr iproute2 python3 python3-apt procps sudo systemd systemd-sysv vim \
|
|
&& apt-get clean; \
|
|
elif [ $(command -v dnf) ]; then \
|
|
dnf makecache \
|
|
&& dnf --assumeyes install bash iproute sudo /usr/bin/dnf-3 /usr/bin/python3 /usr/bin/python3-config vim \
|
|
&& dnf clean all; \
|
|
elif [ $(command -v yum) ]; then \
|
|
yum makecache fast \
|
|
&& yum install -y bash iproute initscripts sudo /usr/bin/python /usr/bin/python2-config vim yum-plugin-ovl http://mirror.centos.org/centos/7/os/x86_64/Packages/pcre2-10.23-2.el7.x86_64.rpm \
|
|
&& sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf \
|
|
&& yum clean all; \
|
|
elif [ $(command -v zypper) ]; then \
|
|
zypper refresh \
|
|
&& zypper install -y bash iproute2 python3 sudo vim \
|
|
&& zypper clean -a; \
|
|
elif [ $(command -v apk) ]; then \
|
|
apk update \
|
|
&& apk add --no-cache bash curl openrc python3 sudo vim; \
|
|
echo 'rc_provide="loopback net"' >> /etc/rc.conf; \
|
|
elif [ $(command -v xbps-install) ]; then \
|
|
xbps-install -Syu \
|
|
&& xbps-install -y bash iproute2 python3 sudo vim \
|
|
&& xbps-remove -O; \
|
|
fi
|