Refactor build container using a matrix

This commit is contained in:
Laurent Indermuehle 2024-06-06 22:16:55 +02:00
parent 50e7413b88
commit 77f707c564
No known key found for this signature in database
GPG key ID: 93FA944C9F34DD09
31 changed files with 180 additions and 594 deletions

View file

@ -23,16 +23,159 @@ jobs:
contents: read contents: read
packages: write packages: write
strategy:
fail-fast: false
matrix:
include:
- from: ubuntu2004
db_client: mariadb
python_minor: '8'
connector_name: pymysql
connector_major: '0'
connector_minor: '9'
connector_release: '3'
- from: ubuntu2004
db_client: mariadb
python_minor: '8'
connector_name: mysqlclient
connector_major: '2'
connector_minor: '0'
connector_release: '1'
- from: ubuntu2204
db_client: mariadb
python_minor: '9' # RHEL9 uses 3.9 by default
connector_name: pymysql
# Same ver. as RHEL package python3-PyMySQL
connector_major: '0'
connector_minor: '10'
connector_release: '1'
- from: ubuntu2004
db_client: mariadb
python_minor: '9'
connector_name: mysqlclient
connector_major: '2'
connector_minor: '0'
connector_release: '3'
- from: ubuntu2204
db_client: mariadb
python_minor: '10'
connector_name: pymysql
connector_major: '1'
connector_minor: '0'
connector_release: '2'
- from: ubuntu2204
db_client: mariadb
python_minor: '10'
connector_name: mysqlclient
connector_major: '2'
connector_minor: '1'
connector_release: '1'
- from: ubuntu2204
db_client: mariadb
python_minor: '11' # RHEL9 uses 3.9 by default
connector_name: pymysql
# Same ver. as RHEL package python3.11-PyMySQL
connector_major: '1'
connector_minor: '0'
connector_release: '2'
- from: ubuntu2204
db_client: mariadb
python_minor: '12' # RHEL9 uses 3.9 by default
connector_name: pymysql
# Same ver. as RHEL package python3.12-PyMySQL
connector_major: '1'
connector_minor: '1'
connector_release: '0'
- from: ubuntu2004
db_client: mysql
python_minor: '8'
connector_name: pymysql
connector_major: '0'
connector_minor: '9'
connector_release: '3'
- from: ubuntu2004
db_client: mysql
python_minor: '8'
connector_name: mysqlclient
connector_major: '2'
connector_minor: '0'
connector_release: '1'
- from: ubuntu2004
db_client: mysql
python_minor: '9'
connector_name: pymysql
connector_major: '0'
connector_minor: '10'
connector_release: '1'
- from: ubuntu2004
db_client: mysql
python_minor: '9'
connector_name: mysqlclient
connector_major: '2'
connector_minor: '0'
connector_release: '3'
- from: ubuntu2204
db_client: mysql
python_minor: '10'
connector_name: pymysql
connector_major: '1'
connector_minor: '0'
connector_release: '2'
- from: ubuntu2204
db_client: mysql
python_minor: '10'
connector_name: mysqlclient
connector_major: '2'
connector_minor: '1'
connector_release: '1'
- from: ubuntu2204
db_client: mysql
python_minor: '11' # RHEL9 uses 3.9 by default
connector_name: pymysql
# Same ver. as RHEL package python3.11-PyMySQL
connector_major: '1'
connector_minor: '0'
connector_release: '2'
- from: ubuntu2204
db_client: mysql
python_minor: '12' # RHEL9 uses 3.9 by default
connector_name: pymysql
# Same ver. as RHEL package python3.12-PyMySQL
connector_major: '1'
connector_minor: '1'
connector_release: '0'
env:
connector_version:
"${{ matrix.connector_major }}.\
${{ matrix.connector_minor }}.\
${{ matrix.connector_release }}"
steps: steps:
# Requirement to use 'context' in docker/build-push-action@v3 # Requirement to use 'context' in docker/build-push-action@v3
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
# https://github.com/docker/login-action # https://github.com/docker/login-action
- name: Log into registry ${{ inputs.registry }} - name: Log into registry ghcr.io
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
registry: ${{ inputs.registry }} registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
@ -42,9 +185,12 @@ jobs:
uses: docker/metadata-action@v4 uses: docker/metadata-action@v4
with: with:
images: images:
"${{ inputs.registry }}\ " ghcr.io\
/${{ github.repository }}\ /${{ github.repository }}\
/${{ inputs.image_name }}" /test-container-${{ matrix.db_client }}-\
py3${{ matrix.python_minor }}-\
${{ matrix.connector_name }}${{ matrix.connector_major }}\
${{ matrix.connector_minor }}${{ matrix.connector_release }}"
tags: latest tags: latest
# Setting up Docker Buildx with docker-container driver is required # Setting up Docker Buildx with docker-container driver is required
@ -59,7 +205,36 @@ jobs:
id: build-and-push id: build-and-push
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: with:
context: ${{ inputs.context }} context: |
FROM quay.io/ansible/${{ matrix.from }}-test-container:main
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \
--no-install-recommends && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends \
python3${{ matrix.python_minor }} \
python3${{ matrix.python_minor }}-dev \
iproute2 \
build-essential \
if [[ "${{ matrix.db_client }}" == "mysql" ]]; then
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends default-libmysqlclient-dev \
mysql-client
else
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends mariadb-client
fi
RUN python3${{ matrix.python_minor }} -m pip install \
--disable-pip-version-check \
--no-cache-dir \
cffi \
${{ matrix.connector_name }}==$connector_version
ENV container=docker
CMD ["/sbin/init"]
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}

View file

@ -1,21 +0,0 @@
---
name: Docker Image CI mariadb-py310-mysqlclient211
on: # yamllint disable-line rule:truthy
push:
paths:
- 'test-containers/mariadb-py310-mysqlclient211/**'
- '.github/workflows/docker-image-mariadb-py310-mysqlclient211.yml'
- '.github/workflows/build-docker-image.yml'
branches-ignore:
- stable-*
jobs:
call-workflow-passing-data:
uses: ./.github/workflows/build-docker-image.yml
secrets: inherit
with:
registry: ghcr.io
image_name: test-container-mariadb-py310-mysqlclient211
context: test-containers/mariadb-py310-mysqlclient211

View file

@ -1,21 +0,0 @@
---
name: Docker Image CI mariadb-py310-pymysql102
on: # yamllint disable-line rule:truthy
push:
paths:
- 'test-containers/mariadb-py310-pymysql102/**'
- '.github/workflows/docker-image-mariadb-py310-pymysql102.yml'
- '.github/workflows/build-docker-image.yml'
branches-ignore:
- stable-*
jobs:
call-workflow-passing-data:
uses: ./.github/workflows/build-docker-image.yml
secrets: inherit
with:
registry: ghcr.io
image_name: test-container-mariadb-py310-pymysql102
context: test-containers/mariadb-py310-pymysql102

View file

@ -1,21 +0,0 @@
---
name: Docker Image CI mariadb-py38-mysqlclient201
on: # yamllint disable-line rule:truthy
push:
paths:
- 'test-containers/mariadb-py38-mysqlclient201/**'
- '.github/workflows/docker-image-mariadb-py38-mysqlclient201.yml'
- '.github/workflows/build-docker-image.yml'
branches-ignore:
- stable-*
jobs:
call-workflow-passing-data:
uses: ./.github/workflows/build-docker-image.yml
secrets: inherit
with:
registry: ghcr.io
image_name: test-container-mariadb-py38-mysqlclient201
context: test-containers/mariadb-py38-mysqlclient201

View file

@ -1,21 +0,0 @@
---
name: Docker Image CI mariadb-py38-pymysql093
on: # yamllint disable-line rule:truthy
push:
paths:
- 'test-containers/mariadb-py38-pymysql093/**'
- '.github/workflows/docker-image-mariadb-py38-pymysql093.yml'
- '.github/workflows/build-docker-image.yml'
branches-ignore:
- stable-*
jobs:
call-workflow-passing-data:
uses: ./.github/workflows/build-docker-image.yml
secrets: inherit
with:
registry: ghcr.io
image_name: test-container-mariadb-py38-pymysql093
context: test-containers/mariadb-py38-pymysql093

View file

@ -1,21 +0,0 @@
---
name: Docker Image CI mariadb-py39-mysqlclient203
on: # yamllint disable-line rule:truthy
push:
paths:
- 'test-containers/mariadb-py39-mysqlclient203/**'
- '.github/workflows/docker-image-mariadb-py39-mysqlclient203.yml'
- '.github/workflows/build-docker-image.yml'
branches-ignore:
- stable-*
jobs:
call-workflow-passing-data:
uses: ./.github/workflows/build-docker-image.yml
secrets: inherit
with:
registry: ghcr.io
image_name: test-container-mariadb-py39-mysqlclient203
context: test-containers/mariadb-py39-mysqlclient203

View file

@ -1,21 +0,0 @@
---
name: Docker Image CI mariadb-py39-pymysql093
on: # yamllint disable-line rule:truthy
push:
paths:
- 'test-containers/mariadb-py39-pymysql093/**'
- '.github/workflows/docker-image-mariadb-py39-pymysql093.yml'
- '.github/workflows/build-docker-image.yml'
branches-ignore:
- stable-*
jobs:
call-workflow-passing-data:
uses: ./.github/workflows/build-docker-image.yml
secrets: inherit
with:
registry: ghcr.io
image_name: test-container-mariadb-py39-pymysql093
context: test-containers/mariadb-py39-pymysql093

View file

@ -1,21 +0,0 @@
---
name: Docker Image CI my57-py38-mysqlclient201
on: # yamllint disable-line rule:truthy
push:
paths:
- 'test-containers/my57-py38-mysqlclient201/**'
- '.github/workflows/docker-image-my57-py38-mysqlclient201.yml'
- '.github/workflows/build-docker-image.yml'
branches-ignore:
- stable-*
jobs:
call-workflow-passing-data:
uses: ./.github/workflows/build-docker-image.yml
secrets: inherit
with:
registry: ghcr.io
image_name: test-container-my57-py38-mysqlclient201
context: test-containers/my57-py38-mysqlclient201

View file

@ -1,21 +0,0 @@
---
name: Docker Image CI my57-py38-pymysql0711
on: # yamllint disable-line rule:truthy
push:
paths:
- 'test-containers/my57-py38-pymysql0711/**'
- '.github/workflows/docker-image-my57-py38-pymysql0711.yml'
- '.github/workflows/build-docker-image.yml'
branches-ignore:
- stable-*
jobs:
call-workflow-passing-data:
uses: ./.github/workflows/build-docker-image.yml
secrets: inherit
with:
registry: ghcr.io
image_name: test-container-my57-py38-pymysql0711
context: test-containers/my57-py38-pymysql0711

View file

@ -1,21 +0,0 @@
---
name: Docker Image CI my57-py38-pymysql093
on: # yamllint disable-line rule:truthy
push:
paths:
- 'test-containers/my57-py38-pymysql093/**'
- '.github/workflows/docker-image-my57-py38-pymysql093.yml'
- '.github/workflows/build-docker-image.yml'
branches-ignore:
- stable-*
jobs:
call-workflow-passing-data:
uses: ./.github/workflows/build-docker-image.yml
secrets: inherit
with:
registry: ghcr.io
image_name: test-container-my57-py38-pymysql093
context: test-containers/my57-py38-pymysql093

View file

@ -1,21 +0,0 @@
---
name: Docker Image CI mysql-py310-mysqlclient211
on: # yamllint disable-line rule:truthy
push:
paths:
- 'test-containers/mysql-py310-mysqlclient211/**'
- '.github/workflows/docker-image-mysql-py310-mysqlclient211.yml'
- '.github/workflows/build-docker-image.yml'
branches-ignore:
- stable-*
jobs:
call-workflow-passing-data:
uses: ./.github/workflows/build-docker-image.yml
secrets: inherit
with:
registry: ghcr.io
image_name: test-container-mysql-py310-mysqlclient211
context: test-containers/mysql-py310-mysqlclient211

View file

@ -1,21 +0,0 @@
---
name: Docker Image CI mysql-py310-pymysql102
on: # yamllint disable-line rule:truthy
push:
paths:
- 'test-containers/mysql-py310-pymysql102/**'
- '.github/workflows/docker-image-mysql-py310-pymysql102.yml'
- '.github/workflows/build-docker-image.yml'
branches-ignore:
- stable-*
jobs:
call-workflow-passing-data:
uses: ./.github/workflows/build-docker-image.yml
secrets: inherit
with:
registry: ghcr.io
image_name: test-container-mysql-py310-pymysql102
context: test-containers/mysql-py310-pymysql102

View file

@ -1,21 +0,0 @@
---
name: Docker Image CI mysql-py38-mysqlclient201
on: # yamllint disable-line rule:truthy
push:
paths:
- 'test-containers/mysql-py38-mysqlclient201/**'
- '.github/workflows/docker-image-mysql-py38-mysqlclient201.yml'
- '.github/workflows/build-docker-image.yml'
branches-ignore:
- stable-*
jobs:
call-workflow-passing-data:
uses: ./.github/workflows/build-docker-image.yml
secrets: inherit
with:
registry: ghcr.io
image_name: test-container-mysql-py38-mysqlclient201
context: test-containers/mysql-py38-mysqlclient201

View file

@ -1,21 +0,0 @@
---
name: Docker Image CI mysql-py38-pymysql093
on: # yamllint disable-line rule:truthy
push:
paths:
- 'test-containers/mysql-py38-pymysql093/**'
- '.github/workflows/docker-image-mysql-py38-pymysql093.yml'
- '.github/workflows/build-docker-image.yml'
branches-ignore:
- stable-*
jobs:
call-workflow-passing-data:
uses: ./.github/workflows/build-docker-image.yml
secrets: inherit
with:
registry: ghcr.io
image_name: test-container-mysql-py38-pymysql093
context: test-containers/mysql-py38-pymysql093

View file

@ -1,21 +0,0 @@
---
name: Docker Image CI mysql-py39-mysqlclient203
on: # yamllint disable-line rule:truthy
push:
paths:
- 'test-containers/mysql-py39-mysqlclient203/**'
- '.github/workflows/docker-image-mysql-py39-mysqlclient203.yml'
- '.github/workflows/build-docker-image.yml'
branches-ignore:
- stable-*
jobs:
call-workflow-passing-data:
uses: ./.github/workflows/build-docker-image.yml
secrets: inherit
with:
registry: ghcr.io
image_name: test-container-mysql-py39-mysqlclient203
context: test-containers/mysql-py39-mysqlclient203

View file

@ -1,21 +0,0 @@
---
name: Docker Image CI mysql-py39-pymysql093
on: # yamllint disable-line rule:truthy
push:
paths:
- 'test-containers/mysql-py39-pymysql093/*'
- '.github/workflows/docker-image-mysql-py39-pymysql093.yml'
- '.github/workflows/build-docker-image.yml'
branches-ignore:
- stable-*
jobs:
call-workflow-passing-data:
uses: ./.github/workflows/build-docker-image.yml
secrets: inherit
with:
registry: ghcr.io
image_name: test-container-mysql-py39-pymysql093
context: test-containers/mysql-py39-pymysql093

View file

@ -1,21 +0,0 @@
FROM quay.io/ansible/ubuntu2204-test-container:main
# ubuntu2204 comes with mariadb-client-10.6
# iproute2 # To grab docker network gateway address
# python3.10-dev # Reqs for mysqlclient
# default-libmysqlclient-dev # Reqs for mysqlclient
# build-essential # Reqs for mysqlclient
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.10 \
python3.10-dev \
mariadb-client \
iproute2 \
default-libmysqlclient-dev \
build-essential
RUN python3.10 -m pip install --disable-pip-version-check --no-cache-dir mysqlclient==2.1.1
ENV container=docker
CMD ["/sbin/init"]

View file

@ -1,15 +0,0 @@
FROM quay.io/ansible/ubuntu2204-test-container:main
# ubuntu2204 comes with mariadb-client-10.6
# iproute2 # To grab docker network gateway address
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.10 \
mariadb-client \
iproute2
RUN python3.10 -m pip install --disable-pip-version-check --no-cache-dir pymysql==1.0.2
ENV container=docker
CMD ["/sbin/init"]

View file

@ -1,21 +0,0 @@
FROM quay.io/ansible/ubuntu2004-test-container:main
# ubuntu2004 comes with mariadb-client-10.3
# iproute2 # To grab docker network gateway address
# python3.8-dev # Reqs for mysqlclient
# default-libmysqlclient-dev # Reqs for mysqlclient
# build-essential # Reqs for mysqlclient
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.8 \
python3.8-dev \
mariadb-client \
iproute2 \
default-libmysqlclient-dev \
build-essential
RUN python3.8 -m pip install --disable-pip-version-check --no-cache-dir mysqlclient==2.0.1
ENV container=docker
CMD ["/sbin/init"]

View file

@ -1,15 +0,0 @@
FROM quay.io/ansible/ubuntu2004-test-container:main
# ubuntu2004 comes with mariadb-client-10.3
# iproute2 # To grab docker network gateway address
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.8 \
mariadb-client \
iproute2
RUN python3.8 -m pip install --disable-pip-version-check --no-cache-dir pymysql==0.9.3
ENV container=docker
CMD ["/sbin/init"]

View file

@ -1,21 +0,0 @@
FROM quay.io/ansible/ubuntu2004-test-container:main
# ubuntu2004 comes with mariadb-client-10.3
# iproute2 # To grab docker network gateway address
# python3.9-dev # Reqs for mysqlclient
# default-libmysqlclient-dev # Reqs for mysqlclient
# build-essential # Reqs for mysqlclient
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.9 \
python3.9-dev \
mariadb-client \
iproute2 \
default-libmysqlclient-dev \
build-essential
RUN python3.9 -m pip install --disable-pip-version-check --no-cache-dir mysqlclient==2.0.3
ENV container=docker
CMD ["/sbin/init"]

View file

@ -1,15 +0,0 @@
FROM quay.io/ansible/ubuntu2004-test-container:main
# ubuntu2004 comes with mariadb-client-10.3
# iproute2 # To grab docker network gateway address
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.9 \
mariadb-client \
iproute2
RUN python3.9 -m pip install --disable-pip-version-check --no-cache-dir pymysql==0.9.3
ENV container=docker
CMD ["/sbin/init"]

View file

@ -1,21 +0,0 @@
FROM quay.io/ansible/ubuntu1804-test-container:main
# ubuntu1804 comes with mysql-client-5.7
# iproute2 # To grab docker network gateway address
# python3.8-dev # Reqs for mysqlclient
# default-libmysqlclient-dev # Reqs for mysqlclient
# build-essential # Reqs for mysqlclient
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.8 \
python3.8-dev \
mysql-client \
iproute2 \
default-libmysqlclient-dev \
build-essential
RUN python3.8 -m pip install --disable-pip-version-check --no-cache-dir mysqlclient==2.0.1
ENV container=docker
CMD ["/sbin/init"]

View file

@ -1,21 +0,0 @@
FROM quay.io/ansible/ubuntu1804-test-container:main
# ubuntu1804 comes with mysql-client-5.7
# iproute2 # To grab docker network gateway address
# python3.8-dev # Reqs for mysqlclient
# default-libmysqlclient-dev # Reqs for mysqlclient
# build-essential # Reqs for mysqlclient
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.8 \
python3.8-dev \
mysql-client \
iproute2 \
default-libmysqlclient-dev \
build-essential
RUN python3.8 -m pip install --disable-pip-version-check --no-cache-dir pymysql==0.7.11
ENV container=docker
CMD ["/sbin/init"]

View file

@ -1,15 +0,0 @@
FROM quay.io/ansible/ubuntu1804-test-container:main
# ubuntu1804 comes with mysql-client-5.7
# iproute2 # To grab docker network gateway address
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.8 \
mysql-client \
iproute2
RUN python3.8 -m pip install --disable-pip-version-check --no-cache-dir pymysql==0.9.3
ENV container=docker
CMD ["/sbin/init"]

View file

@ -1,21 +0,0 @@
FROM quay.io/ansible/ubuntu2204-test-container:main
# ubuntu2204 comes with mysql-client-8
# iproute2 # To grab docker network gateway address
# python3.10-dev # Reqs for mysqlclient
# default-libmysqlclient-dev # Reqs for mysqlclient
# build-essential # Reqs for mysqlclient
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.10 \
python3.10-dev \
mysql-client \
iproute2 \
default-libmysqlclient-dev \
build-essential
RUN python3.10 -m pip install --disable-pip-version-check --no-cache-dir mysqlclient==2.1.1
ENV container=docker
CMD ["/sbin/init"]

View file

@ -1,15 +0,0 @@
FROM quay.io/ansible/ubuntu2204-test-container:main
# ubuntu2204 comes with mysql-client-8
# iproute2 # To grab docker network gateway address
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.10 \
mysql-client \
iproute2
RUN python3.10 -m pip install --disable-pip-version-check --no-cache-dir pymysql==1.0.2
ENV container=docker
CMD ["/sbin/init"]

View file

@ -1,21 +0,0 @@
FROM quay.io/ansible/ubuntu2004-test-container:main
# ubuntu2004 comes with mysql-client-8
# iproute2 # To grab docker network gateway address
# python3.8-dev # Reqs for mysqlclient
# default-libmysqlclient-dev # Reqs for mysqlclient
# build-essential # Reqs for mysqlclient
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.8 \
python3.8-dev \
mysql-client \
iproute2 \
default-libmysqlclient-dev \
build-essential
RUN python3.8 -m pip install --disable-pip-version-check --no-cache-dir mysqlclient==2.0.1
ENV container=docker
CMD ["/sbin/init"]

View file

@ -1,15 +0,0 @@
FROM quay.io/ansible/ubuntu2004-test-container:main
# ubuntu2004 comes with mysql-client-8
# iproute2 # To grab docker network gateway address
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.8 \
mysql-client \
iproute2
RUN python3.8 -m pip install --disable-pip-version-check --no-cache-dir pymysql==0.9.3
ENV container=docker
CMD ["/sbin/init"]

View file

@ -1,21 +0,0 @@
FROM quay.io/ansible/ubuntu2004-test-container:main
# ubuntu2004 comes with mysql-client-8
# iproute2 # To grab docker network gateway address
# python3.9-dev # Reqs for mysqlclient
# default-libmysqlclient-dev # Reqs for mysqlclient
# build-essential # Reqs for mysqlclient
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.9 \
python3.9-dev \
mysql-client \
iproute2 \
default-libmysqlclient-dev \
build-essential
RUN python3.9 -m pip install --disable-pip-version-check --no-cache-dir mysqlclient==2.0.3
ENV container=docker
CMD ["/sbin/init"]

View file

@ -1,16 +0,0 @@
FROM quay.io/ansible/ubuntu2004-test-container:main
# ubuntu2004 comes with mysql-client-8
# iproute2 # To grab docker network gateway address
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.9 \
mysql-client \
iproute2
# cffi # To connect to MySQL 8 with Python3.9 and PyMySQL
RUN python3.9 -m pip install --disable-pip-version-check --no-cache-dir cffi pymysql==0.9.3
ENV container=docker
CMD ["/sbin/init"]