Skip to content

Commit e189db1

Browse files
authored
fix multi-arch build only building for amd64 (#27)
Signed-off-by: urizaf-work <[email protected]>
1 parent 38c48ef commit e189db1

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

mcp/Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,31 @@ RUN echo "Building for platform: $TARGETPLATFORM" && \
6060
find /app/build/ && \
6161
echo "🤖 Build completed !!!"
6262

63+
# Final stage - use target platform
64+
FROM cgr.dev/chainguard/wolfi-base:latest
65+
66+
# Import build arguments for cross-compilation
67+
ARG BUILDPLATFORM
68+
ARG TARGETPLATFORM
69+
ARG TARGETOS
70+
ARG TARGETARCH
71+
72+
ENV LANG=C.UTF-8
73+
ENV LC_ALL=C.UTF-8
74+
ENV NODE_ENV=production
75+
ENV NODE_PATH=/app/node_modules
76+
77+
# Install only runtime dependencies for target platform
78+
RUN apk update && apk add --no-cache \
79+
nodejs \
80+
ca-certificates
81+
82+
WORKDIR /app
83+
84+
# Copy built artifacts from builder stage
85+
COPY --from=builder /app/build /app/build
86+
COPY --from=builder /app/node_modules /app/node_modules
87+
6388
# Create non-root user and verify build directory
6489
RUN addgroup -g 1001 -S nodejs && \
6590
adduser -S kagent -u 1001 -G nodejs

0 commit comments

Comments
 (0)