Skip to content

Commit 520291b

Browse files
committed
Use Target Architecture Argument for docker build
In the spanner emulator, a version of wrench is downloaded. But it is hardcoded to amd64. This change uses the auto populated TARGETARCH argument. Now, we know which architecture to use when downloading the wrench CLI. Should fix the problem for those running the repo on a Macbook. See: #720 (comment)
1 parent 857cb18 commit 520291b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.dev/spanner/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,21 @@
1313
# limitations under the License.
1414

1515
FROM google/cloud-sdk:494.0.0-emulators
16+
# TARGETARCH is an automatic platform ARG enabled by Docker BuildKit.
17+
# https://docs.docker.com/reference/dockerfile/#automatic-platform-args-in-the-global-scope
18+
ARG TARGETARCH
1619

1720
ENV SPANNER_PROJECT_ID=local
1821
ENV SPANNER_INSTANCE_ID=local
1922
ENV SPANNER_DATABASE_ID=local
2023
ENV SPANNER_EMULATOR_HOST=0.0.0.0:9010
2124

2225
# Install Wrench - https://github.com/cloudspannerecosystem/wrench
23-
ENV WRENCH_VERSION="1.7.0"
26+
ENV WRENCH_VERSION="1.10.1"
27+
RUN echo "Downloading for version ${WRENCH_VERSION} for architecture ${TARGETARCH}"
2428
RUN curl \
2529
-L -o wrench.tar.gz \
26-
"https://github.com/cloudspannerecosystem/wrench/releases/download/v${WRENCH_VERSION}/wrench-${WRENCH_VERSION}-linux-amd64.tar.gz" && \
30+
"https://github.com/cloudspannerecosystem/wrench/releases/download/v${WRENCH_VERSION}/wrench-${WRENCH_VERSION}-linux-${TARGETARCH}.tar.gz" && \
2731
tar -xf wrench.tar.gz && mv wrench /bin/
2832

2933
RUN gcloud config set auth/disable_credentials true && \

0 commit comments

Comments
 (0)