-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (123 loc) · 4.45 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Push Docker images on Docker Hub
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: Set up QEMU
uses: docker/setup-qemu-action@v2
- 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
platforms: linux/amd64,linux/arm64/v8
build_scala_images:
needs: build_base_images
strategy:
matrix:
sbt_version: [1.8.2, 1.8.3, 1.9.0, 1.9.1, 1.9.2]
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: Build corretto with sbt installed
id: docker_build_corretto_sbt
uses: docker/build-push-action@v4
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./corretto-emr-dbs-universal-spark-scala
file: ./corretto-emr-dbs-universal-spark-scala/Dockerfile
# Only Java 8 is supported for Spark
build-args: |
JDK_VERSION=8
SBT_VERSION=${{ matrix.sbt_version }}
push: true
tags: infrahelpers/dpp:jdk8-sbt${{ matrix.sbt_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: Set up QEMU
uses: docker/setup-qemu-action@v2
- 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: Load short sha
uses: benjlevesque/short-sha@v2.2
id: short-sha
with:
length: 7
- 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 }}-${{ env.SHA }}
infrahelpers/dpp:jdk${{ matrix.jdk_version }}-python${{ matrix.python_micro_version }}-${{ env.SHA }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64/v8