-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (79 loc) · 2.89 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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