From 961224c6cf5ac24fc49fc52ab3c51a87348ee35d Mon Sep 17 00:00:00 2001 From: Chao Guo Date: Tue, 17 Jan 2017 16:49:13 +0800 Subject: Use install-pip macro in most source images 1. Enable customization of pip packages in source branch of most images 2. All pip packages install uniformly through install-pip macro, user can easily customize his own pip command (For example using a mirror) Co-Authored-By: Mauricio Lima Change-Id: If09582039f690fa4136e8f33200d5da15e092da7 --- docker/keystone/keystone-base/Dockerfile.j2 | 7 ++++++- docker/keystone/keystone/Dockerfile.j2 | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'docker/keystone') diff --git a/docker/keystone/keystone-base/Dockerfile.j2 b/docker/keystone/keystone-base/Dockerfile.j2 index 81e20def3..9b33a5555 100644 --- a/docker/keystone/keystone-base/Dockerfile.j2 +++ b/docker/keystone/keystone-base/Dockerfile.j2 @@ -62,8 +62,13 @@ RUN echo > /etc/apache2/ports.conf {% block keystone_source_install %} ADD keystone-base-archive /keystone-base-source + +{% set keystone_base_pip_packages = [ + '/keystone' +] %} + RUN ln -s keystone-base-source/* keystone \ - && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /keystone \ + && {{ macros.install_pip(keystone_base_pip_packages | customizable("pip_packages")) }} \ && mkdir -p /etc/keystone /var/www/cgi-bin/keystone \ && cp -r /keystone/etc/* /etc/keystone/ \ && cp /var/lib/kolla/venv/bin/keystone-wsgi-admin /var/www/cgi-bin/keystone/admin \ diff --git a/docker/keystone/keystone/Dockerfile.j2 b/docker/keystone/keystone/Dockerfile.j2 index 18b549fb5..196874b1a 100644 --- a/docker/keystone/keystone/Dockerfile.j2 +++ b/docker/keystone/keystone/Dockerfile.j2 @@ -3,12 +3,19 @@ MAINTAINER {{ maintainer }} {% block keystone_header %}{% endblock %} +{% import "macros.j2" as macros with context %} + ADD plugins-archive / COPY keystone_bootstrap.sh /usr/local/bin/kolla_keystone_bootstrap COPY extend_start.sh /usr/local/bin/kolla_extend_start + +{% set keystone_plugins_pip_packages = [ + '/plugins/*' +] %} + RUN chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_keystone_bootstrap \ && if [ "$(ls /plugins)" ]; then \ - pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /plugins/*; \ + {{ macros.install_pip(keystone_plugins_pip_packages | customizable("pip_packages")) }}; \ fi {% block keystone_footer %}{% endblock %} -- cgit v1.2.3