kolla/docker/zookeeper/Dockerfile.j2
Maksim Malchuk 83efe32546 Unify curl use (customisation options)
This change adds and unifies an ability to override hardcoded URLs for
air-gapped environments via the usual blocks mechanism. Also, this
change replaces ENV with ARG instruction for the variables used only
in building images, and uses bash variable expansion where it possible.

This change is a continuation of the I46b77978926fc2b578a68d1aaa944b2198af0685

Change-Id: I1fbad333b1bc95484e6f4c5145d5936a0e2db84f
Signed-off-by: Maksim Malchuk <maksim.malchuk@gmail.com>
2022-03-11 15:58:05 +03:00

44 lines
1.4 KiB
Django/Jinja

FROM {{ namespace }}/{{ infra_image_prefix }}base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}
{% block zookeeper_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{{ macros.configure_user(name='zookeeper', homedir='/opt/zookeeper') }}
{% if base_package_type == 'rpm' %}
{% set zookeeper_packages = [
'java-1.8.0-openjdk-headless',
] %}
{% elif base_package_type == 'deb' %}
{% set zookeeper_packages = [
'default-jre-headless',
] %}
{% endif %}
{{ macros.install_packages(zookeeper_packages | customizable("packages")) }}
{% block zookeeper_version %}
ARG zookeeper_version=3.4.13
ARG zookeeper_url=http://archive.apache.org/dist/zookeeper/zookeeper-${zookeeper_version}/zookeeper-${zookeeper_version}.tar.gz
ARG zookeeper_pkg_sha1sum=a989b527f3f990d471e6d47ee410e57d8be7620b
{% endblock %}
{% block zookeeper_binary_install %}
RUN curl -o /tmp/zookeeper.tar.gz ${zookeeper_url} \
&& echo "${zookeeper_pkg_sha1sum} /tmp/zookeeper.tar.gz" | sha1sum -c \
&& tar --strip 1 -xvf /tmp/zookeeper.tar.gz -C /opt/zookeeper \
&& rm -f /tmp/zookeeper.tar.gz
{% endblock %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{% block zookeeper_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER zookeeper