Skip to content

Commit ccfb590

Browse files
committed
Reapply "Add support for arm64 (#2589)"
This reverts commit ed7b941.
1 parent ed7b941 commit ccfb590

File tree

13 files changed

+51
-27
lines changed

13 files changed

+51
-27
lines changed

skaffold.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ kind: Config
1717
metadata:
1818
name: app
1919
build:
20+
platforms: ["linux/amd64", "linux/arm64"]
2021
artifacts:
2122
# image tags are relative; to specify an image repo (e.g. GCR), you
2223
# must provide a "default repo" using one of the methods described
@@ -49,7 +50,8 @@ build:
4950
tagPolicy:
5051
gitCommit: {}
5152
local:
52-
useBuildkit: false
53+
useDockerCLI: true
54+
useBuildkit: true
5355
manifests:
5456
kustomize:
5557
paths:

src/adservice/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM eclipse-temurin:21@sha256:b5fc642f67dbbd1c4ce811388801cb8480aaca8aa9e56fd6dcda362cfea113f1 AS builder
15+
FROM --platform=$BUILDPLATFORM eclipse-temurin:21.0.5_11-jdk@sha256:a20cfa6afdbf57ff2c4de77ae2d0e3725a6349f1936b5ad7c3d1b06f6d1b840a AS builder
1616

1717
WORKDIR /app
1818

@@ -25,7 +25,7 @@ COPY . .
2525
RUN chmod +x gradlew
2626
RUN ./gradlew installDist
2727

28-
FROM eclipse-temurin:21.0.4_7-jre-alpine@sha256:8cc1202a100e72f6e91bf05ab274b373a5def789ab6d9e3e293a61236662ac27
28+
FROM eclipse-temurin:21.0.5_11-jre-alpine@sha256:4300bfe1e11f3dfc3e3512f39939f9093cf18d0e581d1ab1ccd0512f32fe33f0
2929

3030
# @TODO: https://github.com/GoogleCloudPlatform/microservices-demo/issues/2517
3131
# Download Stackdriver Profiler Java agent

src/cartservice/src/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,24 @@
1313
# limitations under the License.
1414

1515
# https://mcr.microsoft.com/product/dotnet/sdk
16-
FROM mcr.microsoft.com/dotnet/sdk:9.0.100-noble@sha256:bd0365368f46274500ebb086f491703052b8ce23e3d52d3233a23b2020730057 AS builder
16+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0.101-noble@sha256:1f13e67d295e02abdfd187c341f887442bad611eda536766172ced401fc8b9fa AS builder
17+
ARG TARGETARCH
1718
WORKDIR /app
1819
COPY cartservice.csproj .
1920
RUN dotnet restore cartservice.csproj \
20-
-r linux-x64
21+
-a $TARGETARCH
2122
COPY . .
2223
RUN dotnet publish cartservice.csproj \
2324
-p:PublishSingleFile=true \
24-
-r linux-x64 \
25+
-a $TARGETARCH \
2526
--self-contained true \
2627
-p:PublishTrimmed=true \
2728
-p:TrimMode=full \
2829
-c release \
2930
-o /cartservice
3031

3132
# https://mcr.microsoft.com/product/dotnet/runtime-deps
32-
FROM mcr.microsoft.com/dotnet/runtime-deps:9.0.0-noble-chiseled@sha256:5cc893809e2d2869e1a98c1eecc4c6ff6978d53bc3e5342014eff28a058867a4
33+
FROM mcr.microsoft.com/dotnet/runtime-deps:9.0.1-noble-chiseled@sha256:6f7466eda39e24efaf7eab2325e15d776a685d13cc93b4ea0cde9ee4f7982210
3334

3435
WORKDIR /app
3536
COPY --from=builder /cartservice .

src/checkoutservice/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang:1.23.2-alpine@sha256:9dd2625a1ff2859b8d8b01d8f7822c0f528942fe56cfe7a1e7c38d3b8d72d679 AS builder
15+
FROM --platform=$BUILDPLATFORM golang:1.23.4-alpine@sha256:c23339199a08b0e12032856908589a6d41a0dab141b8b3b21f156fc571a3f1d3 AS builder
16+
ARG TARGETOS
17+
ARG TARGETARCH
1618
WORKDIR /src
1719

1820
# restore dependencies
@@ -23,7 +25,7 @@ COPY . .
2325

2426
# Skaffold passes in debug-oriented compiler flags
2527
ARG SKAFFOLD_GO_GCFLAGS
26-
RUN CGO_ENABLED=0 GOOS=linux go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -o /checkoutservice .
28+
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -o /checkoutservice .
2729

2830
FROM scratch
2931

src/currencyservice/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM node:20.17.0-alpine@sha256:2d07db07a2df6830718ae2a47db6fedce6745f5bcd174c398f2acdda90a11c03 AS builder
15+
FROM --platform=$BUILDPLATFORM node:20.18.1-alpine@sha256:24fb6aa7020d9a20b00d6da6d1714187c45ed00d1eb4adb01395843c338b9372 AS builder
1616

1717
# Some packages (e.g. @google-cloud/profiler) require additional
1818
# deps for post-install scripts

src/emailservice/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM python:3.12.7-alpine@sha256:b83d5ec7274bee17d2f4bd0bfbb082f156241e4513f0a37c70500e1763b1d90d AS base
15+
FROM --platform=$BUILDPLATFORM python:3.12.8-alpine@sha256:54bec49592c8455de8d5983d984efff76b6417a6af9b5dcc8d0237bf6ad3bd20 AS base
1616

1717
FROM base AS builder
1818

1919
RUN apk update \
20-
&& apk add --no-cache wget g++ \
20+
&& apk add --no-cache g++ linux-headers \
2121
&& rm -rf /var/cache/apk/*
2222

2323
# get packages
@@ -30,6 +30,10 @@ ENV PYTHONUNBUFFERED=1
3030
# Enable Profiler
3131
ENV ENABLE_PROFILER=1
3232

33+
RUN apk update \
34+
&& apk add --no-cache libstdc++ \
35+
&& rm -rf /var/cache/apk/*
36+
3337
WORKDIR /email_server
3438

3539
# Grab packages from builder

src/frontend/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang:1.23.2-alpine@sha256:9dd2625a1ff2859b8d8b01d8f7822c0f528942fe56cfe7a1e7c38d3b8d72d679 AS builder
15+
FROM --platform=$BUILDPLATFORM golang:1.23.4-alpine@sha256:c23339199a08b0e12032856908589a6d41a0dab141b8b3b21f156fc571a3f1d3 AS builder
16+
ARG TARGETOS
17+
ARG TARGETARCH
1618
WORKDIR /src
1719

1820
# restore dependencies
@@ -22,7 +24,7 @@ COPY . .
2224

2325
# Skaffold passes in debug-oriented compiler flags
2426
ARG SKAFFOLD_GO_GCFLAGS
25-
RUN CGO_ENABLED=0 GOOS=linux go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -o /go/bin/frontend .
27+
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -o /go/bin/frontend .
2628

2729
FROM scratch
2830
WORKDIR /src

src/loadgenerator/Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,24 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM python:3.12.6-slim@sha256:ad48727987b259854d52241fac3bc633574364867b8e20aec305e6e7f4028b26 AS base
15+
FROM --platform=$BUILDPLATFORM python:3.12.8-alpine@sha256:54bec49592c8455de8d5983d984efff76b6417a6af9b5dcc8d0237bf6ad3bd20 AS base
1616

1717
FROM base AS builder
1818

19+
RUN apk update \
20+
&& apk add --no-cache wget g++ linux-headers \
21+
&& rm -rf /var/cache/apk/*
22+
1923
COPY requirements.txt .
2024

2125
RUN pip install --prefix="/install" -r requirements.txt
2226

2327
FROM base
2428

29+
RUN apk update \
30+
&& apk add --no-cache libstdc++ \
31+
&& rm -rf /var/cache/apk/*
32+
2533
WORKDIR /loadgen
2634

2735
COPY --from=builder /install /usr/local

src/paymentservice/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM node:20.17.0-alpine@sha256:2d07db07a2df6830718ae2a47db6fedce6745f5bcd174c398f2acdda90a11c03 AS builder
15+
FROM --platform=$BUILDPLATFORM node:20.18.1-alpine@sha256:24fb6aa7020d9a20b00d6da6d1714187c45ed00d1eb4adb01395843c338b9372 AS builder
1616

1717
# Some packages (e.g. @google-cloud/profiler) require additional
1818
# deps for post-install scripts

src/productcatalogservice/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang:1.23.2-alpine@sha256:9dd2625a1ff2859b8d8b01d8f7822c0f528942fe56cfe7a1e7c38d3b8d72d679 AS builder
15+
FROM --platform=$BUILDPLATFORM golang:1.23.4-alpine@sha256:c23339199a08b0e12032856908589a6d41a0dab141b8b3b21f156fc571a3f1d3 AS builder
16+
ARG TARGETOS
17+
ARG TARGETARCH
1618

1719
WORKDIR /src
1820
# restore dependencies
@@ -22,7 +24,7 @@ COPY . .
2224

2325
# Skaffold passes in debug-oriented compiler flags
2426
ARG SKAFFOLD_GO_GCFLAGS
25-
RUN CGO_ENABLED=0 GOOS=linux go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -o /productcatalogservice .
27+
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -o /productcatalogservice .
2628

2729
FROM scratch
2830

src/recommendationservice/Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM python:3.12.8-alpine@sha256:f92e36f6569658ba9501e2e1e3ca780d61faea8e84edd990a0ed70d0ca8add4a AS base
15+
FROM --platform=$BUILDPLATFORM python:3.12.8-alpine@sha256:54bec49592c8455de8d5983d984efff76b6417a6af9b5dcc8d0237bf6ad3bd20 AS base
1616

1717
FROM base AS builder
1818

1919
RUN apk update \
20-
&& apk add --no-cache \
21-
wget \
22-
g++ \
20+
&& apk add --no-cache g++ linux-headers \
2321
&& rm -rf /var/cache/apk/*
2422

2523
# get packages
@@ -30,6 +28,10 @@ FROM base
3028
# Enable unbuffered logging
3129
ENV PYTHONUNBUFFERED=1
3230

31+
RUN apk update \
32+
&& apk add --no-cache libstdc++ \
33+
&& rm -rf /var/cache/apk/*
34+
3335
# get packages
3436
WORKDIR /recommendationservice
3537

src/shippingservice/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang:1.23.2-alpine@sha256:9dd2625a1ff2859b8d8b01d8f7822c0f528942fe56cfe7a1e7c38d3b8d72d679 AS builder
15+
FROM --platform=$BUILDPLATFORM golang:1.23.4-alpine@sha256:c23339199a08b0e12032856908589a6d41a0dab141b8b3b21f156fc571a3f1d3 AS builder
16+
ARG TARGETOS
17+
ARG TARGETARCH
1618
WORKDIR /src
1719

1820
# restore dependencies
@@ -22,7 +24,7 @@ COPY . .
2224

2325
# Skaffold passes in debug-oriented compiler flags
2426
ARG SKAFFOLD_GO_GCFLAGS
25-
RUN CGO_ENABLED=0 GOOS=linux go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -o /go/bin/shippingservice .
27+
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -o /go/bin/shippingservice .
2628

2729
FROM scratch
2830

src/shoppingassistantservice/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM python:3.12.6-slim@sha256:ad48727987b259854d52241fac3bc633574364867b8e20aec305e6e7f4028b26 AS base
15+
FROM --platform=$BUILDPLATFORM python:3.12.8-slim@sha256:123be5684f39d8476e64f47a5fddf38f5e9d839baff5c023c815ae5bdfae0df7 AS base
1616

1717
FROM base AS builder
1818

1919
RUN apt-get -qq update \
20-
&& apt-get install -y --no-install-recommends \
21-
wget g++ \
20+
&& apt-get install -y --no-install-recommends g++ \
2221
&& rm -rf /var/lib/apt/lists/*
2322

2423
# get packages

0 commit comments

Comments
 (0)