Skip to content

Commit

Permalink
馃帀 Added optional platform flag for build image script (#6000)
Browse files Browse the repository at this point in the history
  • Loading branch information
h7kanna committed Sep 15, 2021
1 parent 2390b54 commit 84b3fbd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ You can build the destination by running:
./gradlew :airbyte-integrations:connectors:destination-<name>:build
```

On Mac M1(Apple Silicon) machines(until openjdk images natively support ARM64 images) set the platform variable as shown below and build
```bash
export DOCKER_BUILD_PLATFORM=linux/amd64
# Must be run from the Airbyte project root
./gradlew :airbyte-integrations:connectors:destination-<name>:build
```

this compiles the java code for your destination and builds a Docker image with the connector. At this point, we haven't implemented anything of value yet, but once we do, you'll use this command to compile your code and Docker image.

{% hint style="info" %}
Expand Down
6 changes: 5 additions & 1 deletion tools/bin/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,9 @@ if [ "$FOLLOW_SYMLINKS" == "true" ]; then
# to use as the build context
tar cL "${exclusions[@]}" . | docker build - "${args[@]}"
else
docker build . "${args[@]}"
if [[ -z "${DOCKER_BUILD_PLATFORM}" ]]; then
docker build . "${args[@]}"
else
docker build --platform="$DOCKER_BUILD_PLATFORM" . "${args[@]}"
fi
fi

0 comments on commit 84b3fbd

Please sign in to comment.