Skip to content

Commit 3a0cf27

Browse files
tulirenschlattk
authored andcommitted
Restore platform option in m1-specific docker compose file (airbytehq#7188)
* Revert "remove platform option temporarily to fix master build (airbytehq#7184)" This reverts commit d9e7bdc. * Test if docker compose works in github action * Use a dedicated docker compose file for m1 * Restore docker-compose command * Update comments * Fix docker compose filename * Add issue link
1 parent 4935b98 commit 3a0cf27

File tree

2 files changed

+78
-1
lines changed

2 files changed

+78
-1
lines changed

build.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,11 @@ task composeBuild {
251251
def buildPlatform = System.getenv('DOCKER_BUILD_PLATFORM') ?: 'linux/amd64'
252252
def buildArch = System.getenv('DOCKER_BUILD_ARCH') ?: 'amd64'
253253
def jdkVersion = System.getenv('JDK_VERSION') ?: '14.0.2'
254+
def dockerComposeFile = buildArch == 'arm64' ? 'docker-compose.build-m1.yaml' : 'docker-compose.build.yaml'
254255
doFirst {
255256
exec {
256257
workingDir rootDir
257-
commandLine 'docker-compose', '-f', 'docker-compose.build.yaml', 'build', '--parallel', '--quiet'
258+
commandLine 'docker-compose', '-f', dockerComposeFile, 'build', '--parallel', '--quiet'
258259
environment 'VERSION', buildTag
259260
environment 'DOCKER_BUILD_PLATFORM', buildPlatform
260261
environment 'DOCKER_BUILD_ARCH', buildArch

docker-compose.build-m1.yaml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# This file is exactly the same as docker-compose.build.yaml, except
2+
# that it specifies the platform. This is a temporary solution for M1
3+
# Mac computers. The platform option is required for M1 users to build
4+
# the project. However, currently, our Github Action runner has an old
5+
# version of docker-compose, which does not support this option. Once
6+
# we upgrade the docker-compose in the runners, we should delete this file.
7+
# Issue: https://github.com/airbytehq/airbyte/issues/7191
8+
9+
version: "3.7"
10+
11+
services:
12+
init:
13+
platform: linux/amd64
14+
image: airbyte/init:${VERSION}
15+
build:
16+
dockerfile: Dockerfile
17+
context: airbyte-config/init
18+
labels:
19+
io.airbyte.git-revision: ${GIT_REVISION}
20+
db:
21+
platform: linux/amd64
22+
image: airbyte/db:${VERSION}
23+
build:
24+
dockerfile: Dockerfile
25+
context: airbyte-db/lib
26+
labels:
27+
io.airbyte.git-revision: ${GIT_REVISION}
28+
scheduler:
29+
platform: ${DOCKER_BUILD_PLATFORM}
30+
image: airbyte/scheduler:${VERSION}
31+
build:
32+
dockerfile: Dockerfile
33+
args:
34+
JDK_VERSION: ${JDK_VERSION}
35+
context: airbyte-scheduler/app
36+
labels:
37+
io.airbyte.git-revision: ${GIT_REVISION}
38+
worker:
39+
platform: ${DOCKER_BUILD_PLATFORM}
40+
image: airbyte/worker:${VERSION}
41+
build:
42+
dockerfile: Dockerfile
43+
args:
44+
ARCH: ${DOCKER_BUILD_ARCH}
45+
JDK_VERSION: ${JDK_VERSION}
46+
context: airbyte-workers
47+
labels:
48+
io.airbyte.git-revision: ${GIT_REVISION}
49+
server:
50+
platform: ${DOCKER_BUILD_PLATFORM}
51+
image: airbyte/server:${VERSION}
52+
build:
53+
dockerfile: Dockerfile
54+
args:
55+
JDK_VERSION: ${JDK_VERSION}
56+
context: airbyte-server
57+
labels:
58+
io.airbyte.git-revision: ${GIT_REVISION}
59+
webapp:
60+
platform: linux/amd64
61+
image: airbyte/webapp:${VERSION}
62+
build:
63+
dockerfile: Dockerfile
64+
context: airbyte-webapp
65+
labels:
66+
io.airbyte.git-revision: ${GIT_REVISION}
67+
migration:
68+
platform: ${DOCKER_BUILD_PLATFORM}
69+
image: airbyte/migration:${VERSION}
70+
build:
71+
dockerfile: Dockerfile
72+
args:
73+
JDK_VERSION: ${JDK_VERSION}
74+
context: airbyte-migration
75+
labels:
76+
io.airbyte.git-revision: ${GIT_REVISION}

0 commit comments

Comments
 (0)