Skip to content

Instantly share code, notes, and snippets.

@socketwench
Created May 8, 2021 03:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save socketwench/4487ad52a3a85178a3a6e9f3faea4287 to your computer and use it in GitHub Desktop.
Save socketwench/4487ad52a3a85178a3a6e9f3faea4287 to your computer and use it in GitHub Desktop.
Install MySQL python lib on Ansible k8s operator
FROM quay.io/operator-framework/ansible-operator:latest
COPY requirements.yml ${HOME}/requirements.yml
RUN ansible-galaxy collection install -r ${HOME}/requirements.yml \
&& chmod -R ug+rwx ${HOME}/.ansible
COPY watches.yaml ${HOME}/watches.yaml
COPY roles/ ${HOME}/roles/
COPY playbooks/ ${HOME}/playbooks/
USER root
ADD https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm /tmp/mysql80-community-release-el8-1.noarch.rpm
RUN yum install -y /tmp/mysql80-community-release-el8-1.noarch.rpm && \
yum install -y mysql-community-client mysql-community-common mysql-community-libs && \
yum install -y gcc python3-devel mysql-community-devel && \
pip3 install mysqlclient && \
yum remove -y gcc python3-devel mysql-community-devel && \
rm -rf /tmp/*
USER ansible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment