Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore platform option in m1-specific docker compose file #7188

Merged
merged 7 commits into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,11 @@ task composeBuild {
def buildPlatform = System.getenv('DOCKER_BUILD_PLATFORM') ?: 'linux/amd64'
def buildArch = System.getenv('DOCKER_BUILD_ARCH') ?: 'amd64'
def jdkVersion = System.getenv('JDK_VERSION') ?: '14.0.2'
def dockerComposeFile = buildArch == 'arm64' ? 'docker-compose.build-m1.yaml' : 'docker-compose.build.yaml'
doFirst {
exec {
workingDir rootDir
commandLine 'docker-compose', '-f', 'docker-compose.build.yaml', 'build', '--parallel', '--quiet'
commandLine 'docker-compose', '-f', dockerComposeFile, 'build', '--parallel', '--quiet'
environment 'VERSION', buildTag
environment 'DOCKER_BUILD_PLATFORM', buildPlatform
environment 'DOCKER_BUILD_ARCH', buildArch
Expand Down
76 changes: 76 additions & 0 deletions docker-compose.build-m1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# This file is exactly the same as docker-compose.build.yaml, except
# that it specifies the platform. This is a temporary solution for M1
# Mac computers. The platform option is required for M1 users to build
# the project. However, currently, our Github Action runner has an old
# version of docker-compose, which does not support this option. Once
# we upgrade the docker-compose in the runners, we should delete this file.
# Issue: https://github.com/airbytehq/airbyte/issues/7191

version: "3.7"

services:
init:
platform: linux/amd64
image: airbyte/init:${VERSION}
build:
dockerfile: Dockerfile
context: airbyte-config/init
labels:
io.airbyte.git-revision: ${GIT_REVISION}
db:
platform: linux/amd64
image: airbyte/db:${VERSION}
build:
dockerfile: Dockerfile
context: airbyte-db/lib
labels:
io.airbyte.git-revision: ${GIT_REVISION}
scheduler:
platform: ${DOCKER_BUILD_PLATFORM}
image: airbyte/scheduler:${VERSION}
build:
dockerfile: Dockerfile
args:
JDK_VERSION: ${JDK_VERSION}
context: airbyte-scheduler/app
labels:
io.airbyte.git-revision: ${GIT_REVISION}
worker:
platform: ${DOCKER_BUILD_PLATFORM}
image: airbyte/worker:${VERSION}
build:
dockerfile: Dockerfile
args:
ARCH: ${DOCKER_BUILD_ARCH}
JDK_VERSION: ${JDK_VERSION}
context: airbyte-workers
labels:
io.airbyte.git-revision: ${GIT_REVISION}
server:
platform: ${DOCKER_BUILD_PLATFORM}
image: airbyte/server:${VERSION}
build:
dockerfile: Dockerfile
args:
JDK_VERSION: ${JDK_VERSION}
context: airbyte-server
labels:
io.airbyte.git-revision: ${GIT_REVISION}
webapp:
platform: linux/amd64
image: airbyte/webapp:${VERSION}
build:
dockerfile: Dockerfile
context: airbyte-webapp
labels:
io.airbyte.git-revision: ${GIT_REVISION}
migration:
platform: ${DOCKER_BUILD_PLATFORM}
image: airbyte/migration:${VERSION}
build:
dockerfile: Dockerfile
args:
JDK_VERSION: ${JDK_VERSION}
context: airbyte-migration
labels:
io.airbyte.git-revision: ${GIT_REVISION}