issue move yum install to front of generated Dockerfile
FROM {{ from }}
-{% if envs %}
-# Environment variables
-ENV \
- {% for env in helper.envs(envs)|sort(attribute='name') %}
- {{ env.name }}="{{ env.value }}" {% if loop.index < loop.length %}\{% endif %}
-
- {% endfor %}
-{% endif %}
-
-{% if labels %}
-# Labels
-LABEL \
- {% for label in labels|sort(attribute='name') %}
- {{ label.name }}="{{ label.value }}" {% if loop.index < loop.length %} \{% endif %}
-
- {% endfor %}
-{% endif %}
-
-{% if ports %}
-# Exposed ports
-EXPOSE {%- for port in helper.ports(ports) %} {{ port }}{% endfor %}
-
-{% endif %}
-
USER root
{% if packages and packages.install %}
@@ -87,6 +63,30 @@ COPY \
{% endif %}
+{% if envs %}
+# Environment variables
+ENV \
+ {% for env in helper.envs(envs)|sort(attribute='name') %}
+ {{ env.name }}="{{ env.value }}" {% if loop.index < loop.length %}\{% endif %}
+
+ {% endfor %}
+{% endif %}
+
+{% if labels %}
+# Labels
+LABEL \
+ {% for label in labels|sort(attribute='name') %}
+ {{ label.name }}="{{ label.value }}" {% if loop.index < loop.length %} \{% endif %}
+
+ {% endfor %}
+{% endif %}
+
+{% if ports %}
+# Exposed ports
+EXPOSE {%- for port in helper.ports(ports) %} {{ port }}{% endfor %}
+
+{% endif %}
+
{%- if execute %}
# Add scripts used to configure the image
COPY modules /tmp/scripts
