Merge "Add blocks for Ubuntu apt setup and package installation"

This commit is contained in:
Jenkins
2017-01-18 13:13:49 +00:00
committed by Gerrit Code Review

View File

@@ -216,13 +216,21 @@ ENV DEBIAN_FRONTEND noninteractive
# Reducing disk footprint # Reducing disk footprint
COPY dpkg_reducing_disk_footprint /etc/dpkg/dpkg.cfg.d/dpkg_reducing_disk_footprint COPY dpkg_reducing_disk_footprint /etc/dpkg/dpkg.cfg.d/dpkg_reducing_disk_footprint
# Need apt-transport-https BEFORE we replace sources.list or apt-get update wont work! {% block base_ubuntu_package_pre %}
# Need apt-transport-https and ca-certificates before replacing sources.list or
# apt-get update will not work if any repositories are accessed via HTTPS
RUN apt-get update \ RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-transport-https ca-certificates \ && apt-get -y install --no-install-recommends apt-transport-https ca-certificates \
&& apt-get clean && apt-get clean
{% endblock %}
{% block base_ubuntu_package_sources_list %}
COPY sources.list.{{ base_distro }} /etc/apt/sources.list COPY sources.list.{{ base_distro }} /etc/apt/sources.list
{% endblock %}
{% block base_ubuntu_package_apt_preferences %}
COPY apt_preferences.{{ base_distro }} /etc/apt/preferences COPY apt_preferences.{{ base_distro }} /etc/apt/preferences
{% endblock %}
{% set base_apt_packages = [ {% set base_apt_packages = [
'apt-utils', 'apt-utils',
@@ -266,12 +274,14 @@ COPY apt_preferences.{{ base_distro }} /etc/apt/preferences
{% endif %} {% endif %}
{% block base_ubuntu_package_installation %} {% block base_ubuntu_package_installation %}
{%- for key in base_apt_keys | customizable('apt_keys') %} {%- block base_ubuntu_package_key_installation %}
{%- if loop.first %}RUN {% else %} && {% endif -%} {%- for key in base_apt_keys | customizable('apt_keys') %}
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 {{ key }} \ {%- if loop.first %}RUN {% else %} && {% endif %}apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 {{ key }}
{% endfor -%} {%- if not loop.last %} \
{%- if base_apt_keys|length ==0 %}RUN {% else %} && {% endif -%} {% endif -%}
apt-get update \ {% endfor %}
{% endblock %}
RUN apt-get update \
&& apt-get -y upgrade \ && apt-get -y upgrade \
&& apt-get -y dist-upgrade \ && apt-get -y dist-upgrade \
&& apt-get -y install --no-install-recommends \ && apt-get -y install --no-install-recommends \