Add helm-repository image

This PS adds helm-repository image which will be used to serve helm
packages from the centralized location to helm clients.

Change-Id: Id41b1275a3e2413a0a017fe0fcd8cc76622ec726
This commit is contained in:
Serguei Bezverkhi 2017-01-06 10:27:47 -05:00
parent ae1cf2c88d
commit f3130455bc

View File

@ -0,0 +1,60 @@
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
MAINTAINER {{ maintainer }}
{% block helm_repository_version %}
ENV helm_version 2.1.3
ENV helm_port 8879
ENV 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 ['ubuntu', 'debian'] %}
{% 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")) }}
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
&& python get-pip.py \
&& rm get-pip.py
RUN pip install pyyaml
RUN curl -Lo /tmp/helm-v${helm_version}-linux-amd64.tar.gz http://storage.googleapis.com/kubernetes-helm/helm-v${helm_version}-linux-amd64.tar.gz \
&& sudo tar --strip-components 1 -C /usr/bin linux-amd64/helm -zxvf /tmp/helm-v${helm_version}-linux-amd64.tar.gz \
&& sudo chmod 755 /usr/bin/helm \
&& rm /tmp/helm-v${helm_version}-linux-amd64.tar.gz
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 %}