Unify curl options

Currently we use couple of curl options throughout Dockerfiles, this change
adds all common options to curlrc (-sSLf) and removes usage of those in
Dockerfiles.

Change-Id: I46b77978926fc2b578a68d1aaa944b2198af0685
This commit is contained in:
Michał Nasiadka 2020-12-02 18:46:53 +01:00
parent e0835803d7
commit 22c32a30e6
22 changed files with 25 additions and 23 deletions

View File

@ -393,7 +393,7 @@ COPY apt_preferences /etc/apt/preferences.d/kolla-custom
{% endif -%} {% endif -%}
{% endfor %} {% endfor %}
{% for key in remote_apt_keys | customizable('remote_apt_keys') %} {% for key in remote_apt_keys | customizable('remote_apt_keys') %}
{%- if loop.first %} RUN {% else %} && {% endif %}curl -L {{ key }} | apt-key add - {%- if loop.first %} RUN {% else %} && {% endif %}curl {{ key }} | apt-key add -
{%- if not loop.last %} \ {%- if not loop.last %} \
{% endif -%} {% endif -%}
{% endfor %} {% endfor %}
@ -427,7 +427,7 @@ COPY curlrc /root/.curlrc
{% block dumb_init_installation %} {% block dumb_init_installation %}
RUN curl -sSL https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_{{debian_arch}} -o /usr/local/bin/dumb-init \ RUN curl https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_{{debian_arch}} -o /usr/local/bin/dumb-init \
&& chmod +x /usr/local/bin/dumb-init && chmod +x /usr/local/bin/dumb-init
{% endblock %} {% endblock %}

View File

@ -1,4 +1,6 @@
# curl default options # curl default options
--fail
--location
--silent --silent
--show-error --show-error
--write-out "curl (%{url_effective}): response: %{http_code}, time: %{time_total}, size: %{size_download}\n" --write-out "curl (%{url_effective}): response: %{http_code}, time: %{time_total}, size: %{size_download}\n"

View File

@ -107,7 +107,7 @@ RUN ln -s /bin/mkdir /usr/bin/mkdir
ARG monasca_output_plugin_tag=1.0.1 ARG monasca_output_plugin_tag=1.0.1
ARG monasca_output_plugin_url=https://github.com/monasca/fluentd-monasca/archive/$monasca_output_plugin_tag.tar.gz ARG monasca_output_plugin_url=https://github.com/monasca/fluentd-monasca/archive/$monasca_output_plugin_tag.tar.gz
RUN curl -sSL $monasca_output_plugin_url -o /tmp/fluentd-monasca.tar.gz \ RUN curl $monasca_output_plugin_url -o /tmp/fluentd-monasca.tar.gz \
&& tar -xvf /tmp/fluentd-monasca.tar.gz -C /tmp \ && tar -xvf /tmp/fluentd-monasca.tar.gz -C /tmp \
&& cd /tmp/fluentd-monasca-* \ && cd /tmp/fluentd-monasca-* \
{%- if fluentd_user == 'fluentd' %} {%- if fluentd_user == 'fluentd' %}

View File

@ -36,7 +36,7 @@ ENV kafka_pkg_sha512sum=9773a85ef2898b4bae20481df4cfd5488bd195fffd700fcc874a9fa5
{% endblock %} {% endblock %}
{% block kafka_install %} {% block kafka_install %}
RUN curl -sSL -o /tmp/kafka.tgz ${kafka_url} \ RUN curl -o /tmp/kafka.tgz ${kafka_url} \
&& echo "${kafka_pkg_sha512sum} /tmp/kafka.tgz" | sha512sum -c \ && echo "${kafka_pkg_sha512sum} /tmp/kafka.tgz" | sha512sum -c \
&& tar --strip 1 -xvf /tmp/kafka.tgz -C /opt/kafka \ && tar --strip 1 -xvf /tmp/kafka.tgz -C /opt/kafka \
&& rm -f /tmp/kafka.tgz && rm -f /tmp/kafka.tgz

View File

@ -61,7 +61,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
] %} ] %}
RUN mkdir -p /requirements \ RUN mkdir -p /requirements \
&& curl -sSL -o /requirements/upper-constraints.txt https://releases.openstack.org/constraints/upper/{{ openstack_release }} \ && curl -o /requirements/upper-constraints.txt https://releases.openstack.org/constraints/upper/{{ openstack_release }} \
&& {{ macros.install_pip(kolla_toolbox_pip_virtualenv_packages | customizable("pip_virtualenv_packages")) }} \ && {{ macros.install_pip(kolla_toolbox_pip_virtualenv_packages | customizable("pip_virtualenv_packages")) }} \
&& virtualenv --system-site-packages {{ virtualenv_path }} && virtualenv --system-site-packages {{ virtualenv_path }}

View File

@ -20,7 +20,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{{ macros.install_packages(mariadb_clustercheck_packages | customizable("packages")) }} {{ macros.install_packages(mariadb_clustercheck_packages | customizable("packages")) }}
{% if base_package_type == 'deb' %} {% if base_package_type == 'deb' %}
RUN curl -sSL -o /usr/bin/clustercheck https://src.fedoraproject.org/rpms/mariadb/raw/10.3/f/clustercheck.sh \ RUN curl -o /usr/bin/clustercheck https://src.fedoraproject.org/rpms/mariadb/raw/10.3/f/clustercheck.sh \
&& chmod 755 /usr/bin/clustercheck && chmod 755 /usr/bin/clustercheck
{% endif %} {% endif %}

View File

@ -56,7 +56,7 @@ ARG monasca_grafana_app_url=https://github.com/monasca/monasca-grafana/archive/$
# NPM installs itself in /usr/local/bin (the default in Ubuntu) which is not in the PATH. # NPM installs itself in /usr/local/bin (the default in Ubuntu) which is not in the PATH.
# This is forced for all distros to avoid conflicts with native packages. # This is forced for all distros to avoid conflicts with native packages.
RUN gem install fpm \ RUN gem install fpm \
&& curl -sSL -o /tmp/monasca-grafana.tgz ${monasca_grafana_url} \ && curl -o /tmp/monasca-grafana.tgz ${monasca_grafana_url} \
&& mkdir -p ${monasca_grafana_build_path} \ && mkdir -p ${monasca_grafana_build_path} \
&& tar --strip 1 -xvf /tmp/monasca-grafana.tgz -C ${monasca_grafana_build_path} \ && tar --strip 1 -xvf /tmp/monasca-grafana.tgz -C ${monasca_grafana_build_path} \
&& rm -f /tmp/monasca-grafana.tgz \ && rm -f /tmp/monasca-grafana.tgz \
@ -87,7 +87,7 @@ RUN grafana-cli plugins install monasca-datasource \
&& chmod 755 /usr/local/bin/kolla_extend_start && chmod 755 /usr/local/bin/kolla_extend_start
RUN mkdir -p /var/lib/grafana/plugins/monasca-grafana \ RUN mkdir -p /var/lib/grafana/plugins/monasca-grafana \
&& curl -Lo tmp.tgz ${monasca_grafana_app_url} \ && curl -o tmp.tgz ${monasca_grafana_app_url} \
&& tar zxvf tmp.tgz -C /var/lib/grafana/plugins/monasca-grafana --strip-components=1 \ && tar zxvf tmp.tgz -C /var/lib/grafana/plugins/monasca-grafana --strip-components=1 \
&& rm tmp.tgz \ && rm tmp.tgz \
&& npm install -g grunt \ && npm install -g grunt \

View File

@ -10,7 +10,7 @@ ENV prometheus_alertmanager_version=0.20.0
{% endblock %} {% endblock %}
{% block prometheus_alertmanager_install %} {% block prometheus_alertmanager_install %}
RUN curl -sSL -o /tmp/prometheus_alertmanager.tar.gz https://github.com/prometheus/alertmanager/releases/download/v${prometheus_alertmanager_version}/alertmanager-${prometheus_alertmanager_version}.linux-{{debian_arch}}.tar.gz \ RUN curl -o /tmp/prometheus_alertmanager.tar.gz https://github.com/prometheus/alertmanager/releases/download/v${prometheus_alertmanager_version}/alertmanager-${prometheus_alertmanager_version}.linux-{{debian_arch}}.tar.gz \
&& tar xvf /tmp/prometheus_alertmanager.tar.gz -C /opt/ \ && tar xvf /tmp/prometheus_alertmanager.tar.gz -C /opt/ \
&& rm -f /tmp/prometheus_alertmanager.tar.gz \ && rm -f /tmp/prometheus_alertmanager.tar.gz \
&& ln -s /opt/alertmanager* /opt/prometheus_alertmanager && ln -s /opt/alertmanager* /opt/prometheus_alertmanager

View File

@ -24,7 +24,7 @@ ENV blackbox_exporter_version=0.16.0
{{ macros.install_packages(blackbox_packages | customizable("packages")) }} {{ macros.install_packages(blackbox_packages | customizable("packages")) }}
{% block prometheus_blackbox_exporter_install %} {% block prometheus_blackbox_exporter_install %}
RUN curl -sSL -o /tmp/blackbox_exporter.tar.gz https://github.com/prometheus/blackbox_exporter/releases/download/v${blackbox_exporter_version}/blackbox_exporter-${blackbox_exporter_version}.linux-{{debian_arch}}.tar.gz \ RUN curl -o /tmp/blackbox_exporter.tar.gz https://github.com/prometheus/blackbox_exporter/releases/download/v${blackbox_exporter_version}/blackbox_exporter-${blackbox_exporter_version}.linux-{{debian_arch}}.tar.gz \
&& tar xvf /tmp/blackbox_exporter.tar.gz -C /opt/ \ && tar xvf /tmp/blackbox_exporter.tar.gz -C /opt/ \
&& rm -f /tmp/blackbox_exporter.tar.gz \ && rm -f /tmp/blackbox_exporter.tar.gz \
&& ln -s /opt/blackbox_exporter* /opt/blackbox_exporter && ln -s /opt/blackbox_exporter* /opt/blackbox_exporter

View File

@ -14,7 +14,7 @@ ENV prometheus_cadvisor_version=0.35.0
{% if base_arch in ['x86_64'] %} {% if base_arch in ['x86_64'] %}
{% block prometheus_cadvisor_install %} {% block prometheus_cadvisor_install %}
RUN curl -ssL -o /opt/cadvisor https://github.com/google/cadvisor/releases/download/v${prometheus_cadvisor_version}/cadvisor && chmod 0755 /opt/cadvisor RUN curl -o /opt/cadvisor https://github.com/google/cadvisor/releases/download/v${prometheus_cadvisor_version}/cadvisor && chmod 0755 /opt/cadvisor
{% endblock %} {% endblock %}
{% else %} {% else %}

View File

@ -10,7 +10,7 @@ ENV elasticsearch_exporter_version=1.1.0
{% endblock %} {% endblock %}
{% block prometheus_elasticsearch_exporter_install %} {% block prometheus_elasticsearch_exporter_install %}
RUN curl -sSL -o /tmp/elasticsearch_exporter.tar.gz https://github.com/justwatchcom/elasticsearch_exporter/releases/download/v${elasticsearch_exporter_version}/elasticsearch_exporter-${elasticsearch_exporter_version}.linux-{{debian_arch}}.tar.gz \ RUN curl -o /tmp/elasticsearch_exporter.tar.gz https://github.com/justwatchcom/elasticsearch_exporter/releases/download/v${elasticsearch_exporter_version}/elasticsearch_exporter-${elasticsearch_exporter_version}.linux-{{debian_arch}}.tar.gz \
&& tar xvf /tmp/elasticsearch_exporter.tar.gz -C /opt/ \ && tar xvf /tmp/elasticsearch_exporter.tar.gz -C /opt/ \
&& rm -f /tmp/elasticsearch_exporter.tar.gz \ && rm -f /tmp/elasticsearch_exporter.tar.gz \
&& ln -s /opt/elasticsearch_exporter* /opt/elasticsearch_exporter && ln -s /opt/elasticsearch_exporter* /opt/elasticsearch_exporter

View File

@ -10,7 +10,7 @@ ENV haproxy_exporter_version=0.10.0
{% endblock %} {% endblock %}
{% block haproxy_exporter_install %} {% block haproxy_exporter_install %}
RUN curl -sSL -o /tmp/haproxy_exporter.tar.gz https://github.com/prometheus/haproxy_exporter/releases/download/v${haproxy_exporter_version}/haproxy_exporter-${haproxy_exporter_version}.linux-{{debian_arch}}.tar.gz \ RUN curl -o /tmp/haproxy_exporter.tar.gz https://github.com/prometheus/haproxy_exporter/releases/download/v${haproxy_exporter_version}/haproxy_exporter-${haproxy_exporter_version}.linux-{{debian_arch}}.tar.gz \
&& tar xvf /tmp/haproxy_exporter.tar.gz -C /opt/ \ && tar xvf /tmp/haproxy_exporter.tar.gz -C /opt/ \
&& rm -f /tmp/haproxy_exporter.tar.gz \ && rm -f /tmp/haproxy_exporter.tar.gz \
&& ln -s /opt/haproxy_exporter* /opt/haproxy_exporter && ln -s /opt/haproxy_exporter* /opt/haproxy_exporter

View File

@ -10,7 +10,7 @@ ENV memcached_exporter_version=0.6.0
{% endblock %} {% endblock %}
{% block prometheus_memcached_exporter_install %} {% block prometheus_memcached_exporter_install %}
RUN curl -sSL -o /tmp/memcached_exporter.tar.gz https://github.com/prometheus/memcached_exporter/releases/download/v${memcached_exporter_version}/memcached_exporter-${memcached_exporter_version}.linux-{{debian_arch}}.tar.gz \ RUN curl -o /tmp/memcached_exporter.tar.gz https://github.com/prometheus/memcached_exporter/releases/download/v${memcached_exporter_version}/memcached_exporter-${memcached_exporter_version}.linux-{{debian_arch}}.tar.gz \
&& tar xvf /tmp/memcached_exporter.tar.gz -C /opt/ \ && tar xvf /tmp/memcached_exporter.tar.gz -C /opt/ \
&& rm -f /tmp/memcached_exporter.tar.gz \ && rm -f /tmp/memcached_exporter.tar.gz \
&& ln -s /opt/memcached_exporter* /opt/memcached_exporter && ln -s /opt/memcached_exporter* /opt/memcached_exporter

View File

@ -18,7 +18,7 @@ ARG prometheus_mtail_url=https://github.com/google/mtail/releases/download/${pro
{% endblock %} {% endblock %}
{% block prometheus_mtail_install %} {% block prometheus_mtail_install %}
RUN curl -sSL -o /opt/mtail ${prometheus_mtail_url} \ RUN curl -o /opt/mtail ${prometheus_mtail_url} \
&& chmod +x /opt/mtail && chmod +x /opt/mtail
{% endblock %} {% endblock %}

View File

@ -10,7 +10,7 @@ ENV mysqld_exporter_version=0.12.1
{% endblock %} {% endblock %}
{% block mysqld_exporter_install %} {% block mysqld_exporter_install %}
RUN curl -ssL -o /tmp/mysqld_exporter.tar.gz https://github.com/prometheus/mysqld_exporter/releases/download/v${mysqld_exporter_version}/mysqld_exporter-${mysqld_exporter_version}.linux-{{debian_arch}}.tar.gz \ RUN curl -o /tmp/mysqld_exporter.tar.gz https://github.com/prometheus/mysqld_exporter/releases/download/v${mysqld_exporter_version}/mysqld_exporter-${mysqld_exporter_version}.linux-{{debian_arch}}.tar.gz \
&& tar xvf /tmp/mysqld_exporter.tar.gz -C /opt/ \ && tar xvf /tmp/mysqld_exporter.tar.gz -C /opt/ \
&& rm -f /tmp/mysqld_exporter.tar.gz \ && rm -f /tmp/mysqld_exporter.tar.gz \
&& ln -s /opt/mysqld_exporter* /opt/mysqld_exporter && ln -s /opt/mysqld_exporter* /opt/mysqld_exporter

View File

@ -10,7 +10,7 @@ ENV node_exporter_version=0.18.1
{% endblock %} {% endblock %}
{% block node_exporter_install %} {% block node_exporter_install %}
RUN curl -sSL -o /tmp/node_exporter.tar.gz https://github.com/prometheus/node_exporter/releases/download/v${node_exporter_version}/node_exporter-${node_exporter_version}.linux-{{debian_arch}}.tar.gz \ RUN curl -o /tmp/node_exporter.tar.gz https://github.com/prometheus/node_exporter/releases/download/v${node_exporter_version}/node_exporter-${node_exporter_version}.linux-{{debian_arch}}.tar.gz \
&& tar xvf /tmp/node_exporter.tar.gz -C /opt/ \ && tar xvf /tmp/node_exporter.tar.gz -C /opt/ \
&& rm -f /tmp/node_exporter.tar.gz \ && rm -f /tmp/node_exporter.tar.gz \
&& ln -s /opt/node_exporter* /opt/node_exporter && ln -s /opt/node_exporter* /opt/node_exporter

View File

@ -10,7 +10,7 @@ ENV prometheus_openstack_exporter_version=1.2.0
{% endblock %} {% endblock %}
{% block prometheus_openstack_exporter_install %} {% block prometheus_openstack_exporter_install %}
RUN curl -sSL -o /tmp/prometheus_openstack_exporter.tar.gz https://github.com/openstack-exporter/openstack-exporter/releases/download/v${prometheus_openstack_exporter_version}/openstack-exporter-${prometheus_openstack_exporter_version}.linux-{{debian_arch}}.tar.gz \ RUN curl -o /tmp/prometheus_openstack_exporter.tar.gz https://github.com/openstack-exporter/openstack-exporter/releases/download/v${prometheus_openstack_exporter_version}/openstack-exporter-${prometheus_openstack_exporter_version}.linux-{{debian_arch}}.tar.gz \
&& tar xvf /tmp/prometheus_openstack_exporter.tar.gz -C /opt/ \ && tar xvf /tmp/prometheus_openstack_exporter.tar.gz -C /opt/ \
&& rm -f /tmp/prometheus_openstack_exporter.tar.gz \ && rm -f /tmp/prometheus_openstack_exporter.tar.gz \
&& ln -s /opt/openstack-exporter* /opt/openstack-exporter && ln -s /opt/openstack-exporter* /opt/openstack-exporter

View File

@ -10,7 +10,7 @@ ENV prometheus_version=1.8.2
{% endblock %} {% endblock %}
{% block prometheus_server_install %} {% block prometheus_server_install %}
RUN curl -sSL -o /tmp/prometheus.tar.gz https://github.com/prometheus/prometheus/releases/download/v${prometheus_version}/prometheus-${prometheus_version}.linux-{{debian_arch}}.tar.gz \ RUN curl -o /tmp/prometheus.tar.gz https://github.com/prometheus/prometheus/releases/download/v${prometheus_version}/prometheus-${prometheus_version}.linux-{{debian_arch}}.tar.gz \
&& tar xvf /tmp/prometheus.tar.gz -C /opt/ \ && tar xvf /tmp/prometheus.tar.gz -C /opt/ \
&& rm -f /tmp/prometheus.tar.gz \ && rm -f /tmp/prometheus.tar.gz \
&& ln -s /opt/prometheus* /opt/prometheus \ && ln -s /opt/prometheus* /opt/prometheus \

View File

@ -15,7 +15,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
RUN echo 'image on {{ base_distro }} is not yet available on non x86_64 platforms' \ RUN echo 'image on {{ base_distro }} is not yet available on non x86_64 platforms' \
&& /bin/false && /bin/false
{% else %} {% else %}
RUN curl -o /usr/bin/skydive -L "https://github.com/skydive-project/skydive/releases/download/v0.26.0/skydive" \ RUN curl -o /usr/bin/skydive "https://github.com/skydive-project/skydive/releases/download/v0.26.0/skydive" \
&& chmod +x /usr/bin/skydive && chmod +x /usr/bin/skydive
{% endif %} {% endif %}

View File

@ -35,7 +35,7 @@ ENV storm_pkg_sha512sum=0a1120b8df7b22edc75f0a412d625841f72f3fb8e9ff5d413d510908
{% endblock %} {% endblock %}
{% block storm_install %} {% block storm_install %}
RUN curl -sSL -o /tmp/storm.tgz ${storm_url} \ RUN curl -o /tmp/storm.tgz ${storm_url} \
&& echo "${storm_pkg_sha512sum} /tmp/storm.tgz" | sha512sum -c \ && echo "${storm_pkg_sha512sum} /tmp/storm.tgz" | sha512sum -c \
&& tar --strip 1 -xvf /tmp/storm.tgz -C /opt/storm \ && tar --strip 1 -xvf /tmp/storm.tgz -C /opt/storm \
&& rm -f /tmp/storm.tgz && rm -f /tmp/storm.tgz

View File

@ -28,7 +28,7 @@ ENV zookeeper_pkg_sha1sum=a989b527f3f990d471e6d47ee410e57d8be7620b
{% endblock %} {% endblock %}
{% block zookeeper_binary_install %} {% block zookeeper_binary_install %}
RUN curl -sSL -o /tmp/zookeeper.tar.gz ${zookeeper_url} \ RUN curl -o /tmp/zookeeper.tar.gz ${zookeeper_url} \
&& echo "${zookeeper_pkg_sha1sum} /tmp/zookeeper.tar.gz" | sha1sum -c \ && echo "${zookeeper_pkg_sha1sum} /tmp/zookeeper.tar.gz" | sha1sum -c \
&& tar --strip 1 -xvf /tmp/zookeeper.tar.gz -C /opt/zookeeper \ && tar --strip 1 -xvf /tmp/zookeeper.tar.gz -C /opt/zookeeper \
&& rm -f /tmp/zookeeper.tar.gz && rm -f /tmp/zookeeper.tar.gz

View File

@ -36,7 +36,7 @@ COPY zun_sudoers /etc/sudoers.d/kolla_zun_sudoers
RUN chmod 750 /etc/sudoers.d \ RUN chmod 750 /etc/sudoers.d \
&& chmod 640 /etc/sudoers.d/kolla_zun_sudoers && chmod 640 /etc/sudoers.d/kolla_zun_sudoers
RUN curl -sSL -o /tmp/cni-plugins-v0.7.1.tgz https://github.com/containernetworking/plugins/releases/download/v0.7.1/cni-plugins-amd64-v0.7.1.tgz \ RUN curl -o /tmp/cni-plugins-v0.7.1.tgz https://github.com/containernetworking/plugins/releases/download/v0.7.1/cni-plugins-amd64-v0.7.1.tgz \
&& tar -C /opt -xzvf /tmp/cni-plugins-v0.7.1.tgz ./loopback \ && tar -C /opt -xzvf /tmp/cni-plugins-v0.7.1.tgz ./loopback \
&& rm -f /tmp/cni-plugins-v0.7.1.tgz && rm -f /tmp/cni-plugins-v0.7.1.tgz