{% include "bash.sh.j2" %}

{% macro runc(cache_only=False) -%}
version=$(curl -s https://api.github.com/repos/opencontainers/runc/releases/latest | grep tag_name | cut -d: -f2 | tr -d 'v," ')
echo $version
wget --quiet --timestamping https://github.com/opencontainers/runc/releases/download/v${version}/runc.amd64
tar -f archive.tar -r runc.amd64
{% if not cache_only -%}
sudo install --mode 0755 runc.amd64 /usr/local/sbin/runc
runc --version
{% endif %}
{% endmacro %}

{% block content %}{{ runc(cache_only) }} {% endblock %}
