Skip to content

Added optional platform flag for build image script #6000

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

Merged
merged 1 commit into from
Sep 15, 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
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