Skip to content

Commit

Permalink
Fix CONNECTORS_BASE build for M1 (#10925)
Browse files Browse the repository at this point in the history
* Pass in arm64

* default value

* fix
  • Loading branch information
girarda committed Mar 8, 2022
1 parent baae713 commit fd13ab1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG JDK_VERSION=17.0.1
FROM openjdk:${JDK_VERSION}-slim

ARG DOCKER_BUILD_ARCH=amd64

# Install Docker to launch worker images. Eventually should be replaced with Docker-java.
# See https://gitter.im/docker-java/docker-java?at=5f3eb87ba8c1780176603f4e for more information on why we are not currently using Docker-java
RUN apt-get update && apt-get install -y \
Expand All @@ -11,7 +13,7 @@ RUN apt-get update && apt-get install -y \
software-properties-common
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
RUN add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
"deb [arch=${DOCKER_BUILD_ARCH}] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
RUN apt-get update && apt-get install -y docker-ce-cli jq
Expand Down
4 changes: 3 additions & 1 deletion airbyte-integrations/bases/standard-source-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG JDK_VERSION=17.0.1
FROM openjdk:${JDK_VERSION}-slim

ARG DOCKER_BUILD_ARCH=amd64

# Install Docker to launch worker images. Eventually should be replaced with Docker-java.
# See https://gitter.im/docker-java/docker-java?at=5f3eb87ba8c1780176603f4e for more information on why we are not currently using Docker-java
RUN apt-get update && apt-get install -y \
Expand All @@ -11,7 +13,7 @@ RUN apt-get update && apt-get install -y \
software-properties-common
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
RUN add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
"deb [arch=${DOCKER_BUILD_ARCH}] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
RUN apt-get update && apt-get install -y docker-ce-cli jq
Expand Down
5 changes: 3 additions & 2 deletions tools/bin/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ DOCKERFILE="$3"
TAGGED_IMAGE="$4"
ID_FILE="$5"
FOLLOW_SYMLINKS="$6"
DOCKER_BUILD_ARCH="${DOCKER_BUILD_ARCH:-amd64}"
# https://docs.docker.com/develop/develop-images/build_enhancements/
export DOCKER_BUILDKIT=1

Expand Down Expand Up @@ -43,8 +44,8 @@ if [ "$FOLLOW_SYMLINKS" == "true" ]; then
else
JDK_VERSION="${JDK_VERSION:-17.0.1}"
if [[ -z "${DOCKER_BUILD_PLATFORM}" ]]; then
docker build --build-arg JDK_VERSION="$JDK_VERSION" . "${args[@]}"
docker build --build-arg JDK_VERSION="$JDK_VERSION" --build-arg DOCKER_BUILD_ARCH="$DOCKER_BUILD_ARCH" . "${args[@]}"
else
docker build --build-arg JDK_VERSION="$JDK_VERSION" --platform="$DOCKER_BUILD_PLATFORM" . "${args[@]}"
docker build --build-arg JDK_VERSION="$JDK_VERSION" --build-arg DOCKER_BUILD_ARCH="$DOCKER_BUILD_ARCH" --platform="$DOCKER_BUILD_PLATFORM" . "${args[@]}"
fi
fi

0 comments on commit fd13ab1

Please sign in to comment.