kolla/docker/helm-repository/Dockerfile.j2
Martin André 3364720f34 Validate Dockerfile indentation in pep8
Delegate code style validation to computers, they're better than human
at it :)

This commit adds a new `tools/validate-indentation.sh` script that
errors when it finds an indented Dockerfile instruction, and enables
the validation in the pep8 check.

Also adjust the logic of `tools/validate-all-dockerfiles.sh` so that it
doesn't stop on first errors but instead shows all of them.

Fixes the remaining indentations in Dockerfiles.

Change-Id: I53c0d38304cb4f6d64a5dfab67f70d69b3eae587
2017-12-05 10:53:49 +01:00

77 lines
2.3 KiB
Django/Jinja

FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% block helm_repository_version %}
ENV helm_version=2.3.0 \
helm_port=8879 \
helm_address=0.0.0.0
{% endblock %}
{% block helm_repository_header %}{% endblock %}
{% set os_client_config='/usr/lib/python2.7/site-packages/os_client_config/defaults.json' %}
{% import "macros.j2" as macros with context %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set helm_repo_packages = [
'git',
'jq',
'python-pip'
] %}
{% elif base_distro in ['debian', 'ubuntu'] %}
{% set helm_repo_packages = [
'git',
'jq',
'python-pip'
] %}
{% if base_distro == 'debian' %}
{% set os_client_config='/usr/local/lib/python2.7/dist-packages/os_client_config/defaults.json' %}
{% endif %}
{% endif %}
{{ macros.install_packages(helm_repo_packages | customizable("packages")) }}
{% block helm_repository_source_install_python_pip %}
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
&& python get-pip.py \
&& rm get-pip.py
{% endblock %}
{% set helm_repository_pip_packages = [
'pyyaml'
] %}
RUN {{ macros.install_pip(helm_repository_pip_packages | customizable("pip_packages"), constraints = false) }}
{% if base_arch == 'x86_64' %}
ENV helm_arch=amd64
{% elif base_arch == 'aarch64' %}
ENV helm_arch=arm64
{% else %}
ENV helm_arch={{ base_arch }}
{% endif %}
{% block helm_repository_install_kubernetes_helm %}
RUN curl -Lo /tmp/helm-v${helm_version}-linux-${helm_arch}.tar.gz http://storage.googleapis.com/kubernetes-helm/helm-v${helm_version}-linux-${helm_arch}.tar.gz \
&& sudo tar --strip-components 1 -C /usr/bin linux-${helm_arch}/helm -zxvf /tmp/helm-v${helm_version}-linux-${helm_arch}.tar.gz \
&& sudo chmod 755 /usr/bin/helm \
&& rm /tmp/helm-v${helm_version}-linux-${helm_arch}.tar.gz
{% endblock %}
RUN useradd --user-group --create-home --home-dir /home/helm helm \
&& sudo mkdir /helm-repo \
&& sudo chmod 755 /helm-repo \
&& sudo chown -R helm: /helm-repo/
USER helm
RUN helm init --client-only
CMD helm serve --address $helm_address:$helm_port --repo-path /helm-repo
{% block helm_repository_footer %}{% endblock %}
{% block footer %}{% endblock %}