fix: remove overwriting of python 2 #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build_base_images: | |
strategy: | |
matrix: | |
jdk_version: [8, 11] | |
environment: docker-hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Run privileged | |
run: sudo docker run --privileged --rm tonistiigi/binfmt --install arm64 | |
- name: Build base corretto image | |
id: docker_build_corretto_base | |
uses: docker/build-push-action@v4 | |
with: | |
builder: ${{ steps.buildx.outputs.name }} | |
context: ./corretto-emr-dbs-universal-base | |
file: ./corretto-emr-dbs-universal-base/Dockerfile | |
build-args: | | |
JDK_VERSION=${{ matrix.jdk_version }} | |
push: true | |
tags: infrahelpers/dpp:jdk${{ matrix.jdk_version }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build_python_images: | |
needs: build_base_images | |
strategy: | |
matrix: | |
jdk_version: [8, 11] | |
python_micro_version: [3.8.16, 3.9.16, 3.10.11, 3.11.3 ] # Use the latest micro versions of each minor version | |
environment: docker-hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Extract Minor Version | |
id: extract_minor_version | |
run: | | |
minor_version=$(echo "${{ matrix.python_micro_version }}" | cut -d. -f1-2) | |
echo "minor_version=${minor_version}" >> $GITHUB_OUTPUT | |
- name: Build corretto with EMR / DBS python installed | |
id: docker_build_corretto_python | |
uses: docker/build-push-action@v4 | |
with: | |
builder: ${{ steps.buildx.outputs.name }} | |
context: ./corretto-emr-dbs-universal-pyspark | |
file: ./corretto-emr-dbs-universal-pyspark/Dockerfile | |
build-args: | | |
JDK_VERSION=${{ matrix.jdk_version }} | |
PYTHON_MINOR_VERSION=${{ steps.extract_minor_version.outputs.minor_version }} | |
PYTHON_MICRO_VERSION=${{ matrix.python_micro_version }} | |
push: true | |
tags: | | |
infrahelpers/dpp:jdk${{ matrix.jdk_version }}-python${{ steps.extract_minor_version.outputs.minor_version }} | |
infrahelpers/dpp:jdk${{ matrix.jdk_version }}-python${{ matrix.python_micro_version }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |