Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

Revert "fix(ci): conditionally set platform in dockerfiles if available"

Marc Klingen4d0e431f2a30
diff --git a/web/Dockerfile b/web/Dockerfile
index 26ecce3f9f..3d7796b782 100644
--- a/web/Dockerfile
+++ b/web/Dockerfile
@@ -1,12 +1,10 @@
-# Use the build argument to conditionally include the platform specification, allowing for multi-platform builds with buildx
-ARG BUILDPLATFORM
-FROM ${BUILDPLATFORM:+--platform=$BUILDPLATFORM }node:20-alpine3.20 AS alpine
+FROM --platform=$BUILDPLATFORM node:20-alpine3.20 AS alpine
# It's important to update the index before installing packages to ensure you're getting the latest versions.
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk update && apk upgrade --no-cache libcrypto3 libssl3 libc6-compat busybox ssl_client
-FROM ${BUILDPLATFORM:+--platform=$BUILDPLATFORM }alpine AS base
+FROM --platform=$BUILDPLATFORM alpine AS base
RUN npm install turbo@^1.13.3 --global
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
@@ -14,14 +12,16 @@ RUN corepack enable
RUN corepack prepare [email protected] --activate
-FROM ${BUILDPLATFORM:+--platform=$BUILDPLATFORM }base AS pruner
+FROM --platform=$BUILDPLATFORM base AS pruner
+
WORKDIR /app
COPY . .
RUN turbo prune --scope=web --docker
-FROM ${BUILDPLATFORM:+--platform=$BUILDPLATFORM }base AS builder
+FROM --platform=$BUILDPLATFORM base AS builder
+
WORKDIR /app
# First install the dependencies (as they change less often)
@@ -57,8 +57,8 @@ ENV NEXT_TELEMETRY_DISABLED 1
RUN turbo run build --filter=web
# Production image, copy all the files and run next
-ARG TARGETPLATFORM
-FROM ${TARGETPLATFORM:+--platform=$TARGETPLATFORM }base AS runner
+FROM --platform=$TARGETPLATFORM base AS runner
+
RUN apk add --no-cache dumb-init
WORKDIR /app
diff --git a/worker/Dockerfile b/worker/Dockerfile
index 524939d239..c541b43b94 100644
--- a/worker/Dockerfile
+++ b/worker/Dockerfile
@@ -1,13 +1,10 @@
-# Use the build argument to conditionally include the platform specification, allowing for multi-platform builds with buildx
-ARG BUILDPLATFORM
-FROM ${BUILDPLATFORM:+--platform=$BUILDPLATFORM }node:20-alpine3.20 AS alpine
-
+FROM --platform=$BUILDPLATFORM node:20-alpine3.20 AS alpine
# It's important to update the index before installing packages to ensure you're getting the latest versions.
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk update && apk upgrade --no-cache libcrypto3 libssl3 libc6-compat busybox ssl_client
-FROM ${BUILDPLATFORM:+--platform=$BUILDPLATFORM }alpine AS base
+FROM --platform=$BUILDPLATFORM alpine AS base
RUN npm install turbo@^1.13.3 --global
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
@@ -15,7 +12,8 @@ RUN corepack enable
RUN corepack prepare [email protected] --activate
-FROM ${BUILDPLATFORM:+--platform=$BUILDPLATFORM }base AS pruner
+FROM --platform=$BUILDPLATFORM base AS pruner
+
WORKDIR /app
COPY . .
@@ -23,7 +21,8 @@ RUN turbo prune --scope=worker --docker
-FROM ${BUILDPLATFORM:+--platform=$BUILDPLATFORM }base AS builder
+FROM --platform=$BUILDPLATFORM base AS builder
+
WORKDIR /app
# First install the dependencies (as they change less often)
@@ -44,9 +43,9 @@ COPY --from=pruner /app/out/full/ .
RUN turbo run build --filter=worker...
-# Production image, copy all the files and run app
-ARG TARGETPLATFORM
-FROM ${TARGETPLATFORM:+--platform=$TARGETPLATFORM }base AS runner
+
+
+FROM --platform=$TARGETPLATFORM base AS runner
WORKDIR /app