kolla/docker/placement/placement-base/Dockerfile.j2
wu.chunyang 4ec824b0a1 remove duplicate package(planned)
remove python3-pymysql from placement since it has added into
openstack-base

Change-Id: Iae240eae5d3e4a9efa42ec73940728775dfc25fb
2020-08-03 22:45:40 +08:00

78 lines
2.2 KiB
Django/Jinja

FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}
{% block placement_base_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{{ macros.configure_user(name='placement') }}
{% if install_type == 'binary' %}
{% if base_package_type == 'rpm' %}
{% set placement_base_packages = [
'mariadb',
'openstack-placement-common',
] %}
{% elif base_package_type == 'deb' %}
{% set placement_base_packages = [
'mariadb-client',
'placement-common',
] %}
{% endif %}
{% if base_distro in ['debian'] %}
{% set mysql_migrate_path = '/usr/share/placement-common/mysql-migrate-db.sh' %}
{% else %}
{% set mysql_migrate_path = '/usr/share/placement/mysql-migrate-db.sh' %}
{% endif %}
{{ macros.install_packages(placement_base_packages | customizable("packages")) }} \
&& cp {{ mysql_migrate_path }} /opt/ \
&& chmod 755 /opt/mysql-migrate-db.sh
{% elif install_type == 'source' %}
{% if base_package_type == 'rpm' %}
{% set placement_base_packages = [
'mariadb',
] %}
{% elif base_package_type == 'deb' %}
{% set placement_base_packages = [
'mariadb-client',
] %}
{% endif %}
{{ macros.install_packages(placement_base_packages | customizable("packages")) }}
ADD placement-base-archive /placement-base-source
ADD plugins-archive /
{% set placement_base_pip_packages = [
'/placement'
] %}
RUN ln -s placement-base-source/* placement \
&& {{ macros.install_pip(placement_base_pip_packages | customizable("pip_packages")) }} \
&& mkdir -p /etc/placement/ \
&& cp -r /placement/etc/placement/* /etc/placement/ \
&& chown -R placement: /etc/placement/ \
&& cp /placement/tools/mysql-migrate-db.sh /opt/ \
&& chmod 755 /opt/mysql-migrate-db.sh
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN touch /usr/local/bin/kolla_placement_extend_start \
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_placement_extend_start
{% block placement_base_footer %}{% endblock %}