kolla/docker/proxysql/Dockerfile.j2
Michal Arbet e5fe2a33b9 Run proxysql with proxysql user
This patch is switching root user to
proxysql user and provides some
necessary changes to work.

Change-Id: Id603cc1e9c084eac8afc4c6d2ddde9a1f4fe6728
2022-07-28 11:52:05 +02:00

42 lines
1.2 KiB
Django/Jinja

FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}
{% block proxysql_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{{ macros.enable_extra_repos(['proxysql']) }}
{% set proxysql_packages = [
'proxysql',
] %}
{% if base_package_type == 'rpm' %}
{% set proxysql_packages = proxysql_packages + [
'python3-PyYAML',
] %}
{% elif base_package_type == 'deb' %}
{% set proxysql_packages = proxysql_packages + [
'python3-yaml',
] %}
{% endif %}
{{ macros.configure_user(name='proxysql') }}
{{ macros.install_packages(proxysql_packages | customizable("packages")) }}
COPY kolla_proxysql_config_sync kolla_extend_start /usr/local/bin/
RUN chmod 755 /usr/local/bin/kolla_proxysql_config_sync \
&& chmod 644 /usr/local/bin/kolla_extend_start
RUN install -g proxysql -o proxysql -m 770 -d /var/lib/kolla/proxysql \
&& touch /etc/proxysql.cnf \
&& chown proxysql:proxysql /etc/proxysql.cnf \
&& chmod 600 /etc/proxysql.cnf
{% block proxysql_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER proxysql