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 \
|
2021-10-06 00:20:23 +02:00
|
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y aptitude bash curl dirmngr iproute2 python3 python3-apt procps sudo systemd systemd-sysv vim \
|
2019-11-21 19:53:30 +01:00
|
|
|
&& apt-get clean; \
|
|
|
|
elif [ $(command -v dnf) ]; then \
|
|
|
|
dnf makecache \
|
2020-12-23 15:03:22 +01:00
|
|
|
&& dnf --assumeyes install bash iproute sudo /usr/bin/dnf-3 /usr/bin/python3 /usr/bin/python3-config vim \
|
2019-11-21 19:53:30 +01:00
|
|
|
&& dnf clean all; \
|
|
|
|
elif [ $(command -v yum) ]; then \
|
|
|
|
yum makecache fast \
|
2022-03-17 23:50:41 +01:00
|
|
|
&& 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 \
|
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-09-15 21:27:06 +02:00
|
|
|
&& zypper install -y bash iproute2 python3 sudo vim \
|
2019-11-21 19:53:30 +01:00
|
|
|
&& zypper clean -a; \
|
|
|
|
elif [ $(command -v apk) ]; then \
|
|
|
|
apk update \
|
2021-10-06 00:20:23 +02:00
|
|
|
&& apk add --no-cache bash curl openrc python3 sudo vim; \
|
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 \
|
2021-10-06 00:20:23 +02:00
|
|
|
&& xbps-install -y bash iproute2 python3 sudo vim \
|
2019-11-21 19:53:30 +01:00
|
|
|
&& xbps-remove -O; \
|
|
|
|
fi
|